mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
✨ Add new select ds component to storybook
This commit is contained in:
parent
f2a2d772b0
commit
0c6b0598fa
3 changed files with 69 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
[app.main.ui.ds.buttons.button :refer [button*]]
|
||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||
[app.main.ui.ds.controls.input :refer [input*]]
|
||||
[app.main.ui.ds.controls.select :refer [select*]]
|
||||
[app.main.ui.ds.foundations.assets.icon :refer [icon* icon-list]]
|
||||
[app.main.ui.ds.foundations.assets.raw-svg :refer [raw-svg* raw-svg-list]]
|
||||
[app.main.ui.ds.foundations.typography :refer [typography-list]]
|
||||
|
@ -28,6 +29,7 @@
|
|||
:Input input*
|
||||
:Loader loader*
|
||||
:RawSvg raw-svg*
|
||||
:Select select*
|
||||
:Text text*
|
||||
:TabSwitcher tab-switcher*
|
||||
:Toast toast*
|
||||
|
|
|
@ -11,7 +11,7 @@ const { Input } = Components;
|
|||
const { icons } = Components.meta;
|
||||
|
||||
export default {
|
||||
title: "Forms/Input",
|
||||
title: "Controls/Input",
|
||||
component: Components.Input,
|
||||
argTypes: {
|
||||
icon: {
|
||||
|
|
66
frontend/src/app/main/ui/ds/controls/select.stories.jsx
Normal file
66
frontend/src/app/main/ui/ds/controls/select.stories.jsx
Normal file
|
@ -0,0 +1,66 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
//
|
||||
// Copyright (c) KALEIDOS INC
|
||||
|
||||
import * as React from "react";
|
||||
import Components from "@target/components";
|
||||
|
||||
const { Select } = Components;
|
||||
|
||||
export default {
|
||||
title: "Controls/Select",
|
||||
component: Select,
|
||||
argTypes: {
|
||||
disabled: { control: "boolean" },
|
||||
},
|
||||
args: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{
|
||||
label: "Code",
|
||||
id: "option-code",
|
||||
},
|
||||
{
|
||||
label: "Design",
|
||||
id: "option-design",
|
||||
},
|
||||
{
|
||||
label: "Menu",
|
||||
id: "opeion-menu",
|
||||
},
|
||||
],
|
||||
defaultSelected: "option-code",
|
||||
},
|
||||
parameters: {
|
||||
controls: {
|
||||
exclude: ["options", "defaultSelected"],
|
||||
},
|
||||
},
|
||||
render: ({ ...args }) => <Select {...args} />,
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
|
||||
export const WithIcons = {
|
||||
args: {
|
||||
options: [
|
||||
{
|
||||
label: "Code",
|
||||
id: "option-code",
|
||||
icon: "fill-content",
|
||||
},
|
||||
{
|
||||
label: "Design",
|
||||
id: "option-design",
|
||||
icon: "pentool",
|
||||
},
|
||||
{
|
||||
label: "Menu",
|
||||
id: "option-menu",
|
||||
icon: "mask",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
Loading…
Reference in a new issue