@colisweb/rescript-toolkit 2.67.0 → 2.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +3 -2
- package/.yarn/cache/boolbase-npm-1.0.0-965fe9af6d-3e25c80ef6.zip +0 -0
- package/.yarn/cache/camelcase-npm-3.0.0-0c65af0c7f-ae4fe1c17c.zip +0 -0
- package/.yarn/cache/comma-separated-tokens-npm-1.0.8-00dbbf3418-0adcb07174.zip +0 -0
- package/.yarn/cache/css-selector-parser-npm-1.4.1-b8c642c4c5-31948754e5.zip +0 -0
- package/.yarn/cache/fault-npm-2.0.1-c462630f58-c9b30f47d9.zip +0 -0
- package/.yarn/cache/format-npm-0.2.2-679f3acc64-646a60e133.zip +0 -0
- package/.yarn/cache/github-slugger-npm-2.0.0-3afba76e6c-250375cde2.zip +0 -0
- package/.yarn/cache/hast-util-has-property-npm-1.0.4-a09b607810-23025cee66.zip +0 -0
- package/.yarn/cache/hast-util-has-property-npm-2.0.1-aa6919669c-cc909b7e29.zip +0 -0
- package/.yarn/cache/hast-util-heading-rank-npm-2.1.1-0d71da5801-a49233e9ac.zip +0 -0
- package/.yarn/cache/hast-util-is-element-npm-1.1.0-be10e62fa7-30fad3f65e.zip +0 -0
- package/.yarn/cache/hast-util-is-element-npm-2.1.3-3051d610ff-9d988f6839.zip +0 -0
- package/.yarn/cache/hast-util-select-npm-1.0.1-115974f390-9cdb20850f.zip +0 -0
- package/.yarn/cache/hast-util-to-string-npm-2.0.0-c6108aa2b8-0c087f8dee.zip +0 -0
- package/.yarn/cache/hast-util-to-text-npm-3.1.2-922eb1f623-d17cf3344c.zip +0 -0
- package/.yarn/cache/hast-util-whitespace-npm-1.0.4-43bb1ff3d0-b7f4a1942b.zip +0 -0
- package/.yarn/cache/{husky-npm-8.0.2-46c70b41ed-e101656fcb.zip → husky-npm-8.0.3-b0b59c5127-837bc7e441.zip} +0 -0
- package/.yarn/cache/lowlight-npm-2.8.0-c65abb6cac-c45a91e715.zip +0 -0
- package/.yarn/cache/not-npm-0.1.0-a1712708cd-8043bb53bc.zip +0 -0
- package/.yarn/cache/nth-check-npm-1.0.2-3f6d0d22eb-59e115fdd7.zip +0 -0
- package/.yarn/cache/property-information-npm-3.2.0-ae434c241d-ed2614520d.zip +0 -0
- package/.yarn/cache/rehype-add-classes-npm-1.0.0-ddf6b4e74d-25c0e2dbf5.zip +0 -0
- package/.yarn/cache/rehype-autolink-headings-npm-6.1.1-fe8058cc11-60782fb2e5.zip +0 -0
- package/.yarn/cache/rehype-highlight-npm-6.0.0-5179257139-5a70e7ad45.zip +0 -0
- package/.yarn/cache/rehype-slug-npm-5.1.0-ae08840ba8-2a7c17fd74.zip +0 -0
- package/.yarn/cache/space-separated-tokens-npm-1.1.5-2352c83473-8ef68f1cfa.zip +0 -0
- package/.yarn/cache/unist-util-find-after-npm-4.0.0-11b3b7fb4f-8381ef0bad.zip +0 -0
- package/.yarn/cache/zwitch-npm-1.0.5-5911cef6ce-28a1bebaca.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/package.json +8 -5
- package/playground/{App.res → PlaygroundApp.res} +14 -7
- package/playground/PlaygroundComponents.res +114 -0
- package/playground/PlaygroundLocales.res +1 -0
- package/playground/PlaygroundRouter.res +23 -0
- package/playground/{CodeBlock.res → Playground_CodeBlock.res} +12 -16
- package/playground/components/Playground_Alert.res +25 -0
- package/playground/components/Playground_Button.res +75 -0
- package/playground/components/Playground_Label.res +16 -0
- package/playground/components/Playground_Modal.res +53 -0
- package/playground/components/Playground_MultiSelect.res +91 -0
- package/playground/components/Playground_Switch.res +2 -2
- package/playground/custom.css +4 -1
- package/playground/{stories/IntroductionColors.stories.mdx → design/DesignSystem_Colors.mdx} +0 -0
- package/playground/{stories/IntroductionFonts.stories.mdx → design/DesignSystem_Fonts.mdx} +0 -0
- package/playground/{stories/IntroductionMediaQueries.stories.mdx → design/DesignSystem_MediaQueries.mdx} +0 -0
- package/playground/design/Playground_DesignSystem.res +12 -0
- package/playground/{stories/TailwindConfigBreakpoints.js → design/TailwindConfigBreakpoints.jsx} +1 -1
- package/playground/{stories/TailwindConfigColorsPreview.js → design/TailwindConfigColorsPreview.jsx} +1 -1
- package/playground/{stories/TailwindConfigFontsPreview.js → design/TailwindConfigFontsPreview.jsx} +1 -1
- package/playground/docs/ApiDecoding.mdx +70 -0
- package/playground/docs/Form.mdx +109 -0
- package/playground/docs/Identifiers.mdx +38 -0
- package/playground/{Doc.res → docs/Playground_Docs.res} +8 -8
- package/playground/docs/Primitives.mdx +53 -0
- package/playground/docs/Request.mdx +281 -0
- package/playground/docs/Router.mdx +43 -0
- package/playground/docs/Setup.mdx +51 -0
- package/playground/docs/Unleash.mdx +53 -0
- package/playground/main.jsx +1 -1
- package/src/intl/Toolkit__Intl.res +5 -9
- package/src/intl/Toolkit__Intl.resi +1 -0
- package/src/logger/Toolkit__BrowserLogger.res +15 -15
- package/src/router/Toolkit__Router.res +2 -1
- package/src/tailwind/tailwind.config.cjs +3 -5
- package/src/ui/Toolkit__Ui_MultiSelect.res +21 -0
- package/src/ui/styles.css +6 -3
- package/vite.config.js +44 -1
- package/.yarn/cache/cosmiconfig-npm-7.0.0-b9d0d7d156-6801feaa02.zip +0 -0
- package/.yarn/cache/import-fresh-npm-3.3.0-3e34265ca9-2cacfad06e.zip +0 -0
- package/.yarn/cache/klona-npm-2.0.4-6bc4e7cd86-abc6690882.zip +0 -0
- package/.yarn/cache/postcss-loader-npm-4.2.0-f01fec2503-c45ec1ca1b.zip +0 -0
- package/.yarn/cache/semver-npm-7.3.4-4c3baf0ead-96451bfd7c.zip +0 -0
- package/playground/Playground_Component.res +0 -33
- package/playground/Playground_ComponentDetails.res +0 -25
- package/playground/Playground_ComponentsList.res +0 -43
- package/playground/stories/Toolkit__UI_AlertStory.res +0 -111
- package/playground/stories/Toolkit__UI_LabelStory.res +0 -39
- package/playground/stories/Toolkit__UI_ModalStory.res +0 -211
- package/playground/stories/Toolkit__UI_MultiSelectStory.res +0 -132
- package/playground/stories/Toolkit__Ui_ButtonStory.res +0 -324
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
open Storybook
|
|
2
|
-
open Toolkit__Ui
|
|
3
|
-
|
|
4
|
-
@module("!!raw-loader!../../../src/ui/Toolkit__Ui_Modal.resi")
|
|
5
|
-
external source: 'a = "default"
|
|
6
|
-
|
|
7
|
-
let default = CSF.make(~title="Components/Modal", ())
|
|
8
|
-
|
|
9
|
-
let defaultExample = () => {
|
|
10
|
-
let modalSize = [("lg", #lg), ("md", #md), ("sm", #sm), ("xs", #xs)]
|
|
11
|
-
|
|
12
|
-
let (isVisible, setVisibility) = React.useState(() => false)
|
|
13
|
-
let (size, setSize) = React.useState(() => #md)
|
|
14
|
-
|
|
15
|
-
<div>
|
|
16
|
-
<div className="mb-4">
|
|
17
|
-
<label htmlFor="size"> {"Size :"->React.string} </label>
|
|
18
|
-
<select
|
|
19
|
-
id="size"
|
|
20
|
-
onChange={event => {
|
|
21
|
-
let value = (event->ReactEvent.Form.target)["value"]
|
|
22
|
-
|
|
23
|
-
setSize(_ => value)
|
|
24
|
-
}}>
|
|
25
|
-
{modalSize
|
|
26
|
-
->Array.map(((label, value)) =>
|
|
27
|
-
<option value={value->Obj.magic} selected={value == size}> {label->React.string} </option>
|
|
28
|
-
)
|
|
29
|
-
->React.array}
|
|
30
|
-
</select>
|
|
31
|
-
</div>
|
|
32
|
-
<Button onClick={_ => setVisibility(_ => true)}> {"Show modal"->React.string} </Button>
|
|
33
|
-
<Modal
|
|
34
|
-
isVisible
|
|
35
|
-
title={"title"->React.string}
|
|
36
|
-
body={"Body"->React.string}
|
|
37
|
-
hide={() => setVisibility(_ => false)}
|
|
38
|
-
size
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
defaultExample->CSF.addMeta(
|
|
44
|
-
~name="default",
|
|
45
|
-
~parameters={
|
|
46
|
-
"docs": {
|
|
47
|
-
"page": () => <>
|
|
48
|
-
<CodeBlock> source </CodeBlock>
|
|
49
|
-
<Docs.Source
|
|
50
|
-
language="rescript"
|
|
51
|
-
code=j`
|
|
52
|
-
let (isVisible, setVisibility) = React.useState(() => false);
|
|
53
|
-
|
|
54
|
-
<>
|
|
55
|
-
<button onClick={_ => setVisibility(_ => true)}>
|
|
56
|
-
"Show modal"->React.string
|
|
57
|
-
</button>
|
|
58
|
-
<Modal
|
|
59
|
-
isVisible
|
|
60
|
-
title={"title"->React.string}
|
|
61
|
-
body={"Body"->React.string}
|
|
62
|
-
hide={() => setVisibility(_ => false)}
|
|
63
|
-
/>
|
|
64
|
-
</>;
|
|
65
|
-
`
|
|
66
|
-
/>
|
|
67
|
-
<Docs.Story id="components-modal--default" />
|
|
68
|
-
</>,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
(),
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
let coloredExample = () => {
|
|
75
|
-
let modalSize = [("lg", #lg), ("md", #md), ("sm", #sm), ("xs", #xs)]
|
|
76
|
-
|
|
77
|
-
let modalColor: array<(string, Modal.color)> = [
|
|
78
|
-
("primary", #primary),
|
|
79
|
-
("success", #success),
|
|
80
|
-
("danger", #danger),
|
|
81
|
-
("neutral", #neutral),
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
let (isVisible, setVisibility) = React.useState(() => false)
|
|
85
|
-
let (size, setSize) = React.useState(() => #md)
|
|
86
|
-
let (color, setColor) = React.useState(() => #primary)
|
|
87
|
-
|
|
88
|
-
<div>
|
|
89
|
-
<div>
|
|
90
|
-
<label htmlFor="size"> {"Size :"->React.string} </label>
|
|
91
|
-
<select
|
|
92
|
-
id="size"
|
|
93
|
-
onChange={event => {
|
|
94
|
-
let value = (event->ReactEvent.Form.target)["value"]
|
|
95
|
-
|
|
96
|
-
setSize(_ => value)
|
|
97
|
-
}}>
|
|
98
|
-
{modalSize
|
|
99
|
-
->Array.map(((label, value)) =>
|
|
100
|
-
<option value={value->Obj.magic} selected={value == size}> {label->React.string} </option>
|
|
101
|
-
)
|
|
102
|
-
->React.array}
|
|
103
|
-
</select>
|
|
104
|
-
</div>
|
|
105
|
-
<div>
|
|
106
|
-
<label htmlFor="color"> {"color :"->React.string} </label>
|
|
107
|
-
<select
|
|
108
|
-
onChange={event => {
|
|
109
|
-
let value = (event->ReactEvent.Form.target)["value"]
|
|
110
|
-
|
|
111
|
-
setColor(_ => value)
|
|
112
|
-
}}>
|
|
113
|
-
{modalColor
|
|
114
|
-
->Array.map(((label, value)) =>
|
|
115
|
-
<option value={value->Obj.magic} selected={value == color}>
|
|
116
|
-
{label->React.string}
|
|
117
|
-
</option>
|
|
118
|
-
)
|
|
119
|
-
->React.array}
|
|
120
|
-
</select>
|
|
121
|
-
</div>
|
|
122
|
-
<Button onClick={_ => setVisibility(_ => true)}> {"Show modal"->React.string} </Button>
|
|
123
|
-
<Modal
|
|
124
|
-
isVisible
|
|
125
|
-
title={"title"->React.string}
|
|
126
|
-
body={"Body"->React.string}
|
|
127
|
-
hide={() => setVisibility(_ => false)}
|
|
128
|
-
size
|
|
129
|
-
type_=#colored(color)
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
coloredExample->CSF.addMeta(
|
|
135
|
-
~name="colored",
|
|
136
|
-
~parameters={
|
|
137
|
-
"docs": {
|
|
138
|
-
"page": () => <>
|
|
139
|
-
<CodeBlock> source </CodeBlock>
|
|
140
|
-
<Docs.Source
|
|
141
|
-
language="rescript"
|
|
142
|
-
code=j`
|
|
143
|
-
let modalSize = [|("lg", #lg), ("md", #md), ("sm", #sm), ("xs", #xs)|];
|
|
144
|
-
|
|
145
|
-
let modalColor: array((string, Modal.color)) = [|
|
|
146
|
-
("primary", #primary),
|
|
147
|
-
("success", #success),
|
|
148
|
-
("danger", #danger),
|
|
149
|
-
("neutral", #neutral),
|
|
150
|
-
|];
|
|
151
|
-
|
|
152
|
-
let (isVisible, setVisibility) = React.useState(() => false);
|
|
153
|
-
let (size, setSize) = React.useState(() => #md);
|
|
154
|
-
let (color, setColor) = React.useState(() => #primary);
|
|
155
|
-
|
|
156
|
-
<div>
|
|
157
|
-
<div>
|
|
158
|
-
<label htmlFor="size"> "Size :"->React.string </label>
|
|
159
|
-
<select
|
|
160
|
-
id="size"
|
|
161
|
-
onChange={event => {
|
|
162
|
-
let value = event->ReactEvent.Form.target##value;
|
|
163
|
-
|
|
164
|
-
setSize(_ => value);
|
|
165
|
-
}}>
|
|
166
|
-
{modalSize
|
|
167
|
-
->Array.map(((label, value)) => {
|
|
168
|
-
<option value={value->Obj.magic} selected={value == size}>
|
|
169
|
-
label->React.string
|
|
170
|
-
</option>
|
|
171
|
-
})
|
|
172
|
-
->React.array}
|
|
173
|
-
</select>
|
|
174
|
-
</div>
|
|
175
|
-
<div>
|
|
176
|
-
<label htmlFor="color"> "color :"->React.string </label>
|
|
177
|
-
<select
|
|
178
|
-
onChange={event => {
|
|
179
|
-
let value = event->ReactEvent.Form.target##value;
|
|
180
|
-
|
|
181
|
-
setColor(_ => value);
|
|
182
|
-
}}>
|
|
183
|
-
{modalColor
|
|
184
|
-
->Array.map(((label, value)) => {
|
|
185
|
-
<option value={value->Obj.magic} selected={value == color}>
|
|
186
|
-
label->React.string
|
|
187
|
-
</option>
|
|
188
|
-
})
|
|
189
|
-
->React.array}
|
|
190
|
-
</select>
|
|
191
|
-
</div>
|
|
192
|
-
<Button onClick={_ => setVisibility(_ => true)}>
|
|
193
|
-
"Show modal"->React.string
|
|
194
|
-
</Button>
|
|
195
|
-
<Modal
|
|
196
|
-
isVisible
|
|
197
|
-
title={"title"->React.string}
|
|
198
|
-
body={"Body"->React.string}
|
|
199
|
-
hide={() => setVisibility(_ => false)}
|
|
200
|
-
size
|
|
201
|
-
type_={#colored(color)}
|
|
202
|
-
/>
|
|
203
|
-
</div>;
|
|
204
|
-
`
|
|
205
|
-
/>
|
|
206
|
-
<Docs.Story id="components-modal--colored" />
|
|
207
|
-
</>,
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
(),
|
|
211
|
-
)
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
open Storybook
|
|
2
|
-
|
|
3
|
-
@module("!!raw-loader!../../../src/ui/Toolkit__Ui_MultiSelect.resi")
|
|
4
|
-
external source: 'a = "default"
|
|
5
|
-
|
|
6
|
-
let default = CSF.make(~title="Components/MultiSelect", ())
|
|
7
|
-
|
|
8
|
-
let example = () => {
|
|
9
|
-
let options1: array<Toolkit__Ui_MultiSelect.item> = [
|
|
10
|
-
{
|
|
11
|
-
itemLabel: <p className="flex flex-row text-danger-500">
|
|
12
|
-
<BsReactIcons.FaAngleDown /> {"test"->React.string}
|
|
13
|
-
</p>,
|
|
14
|
-
label: "Test",
|
|
15
|
-
value: "test",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
itemLabel: <p> {"test2"->React.string} </p>,
|
|
19
|
-
label: "Test2",
|
|
20
|
-
value: "test2",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
itemLabel: <p> {"test3"->React.string} </p>,
|
|
24
|
-
label: "Test3",
|
|
25
|
-
value: "test3",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
itemLabel: <p> {"test4"->React.string} </p>,
|
|
29
|
-
label: "Test4",
|
|
30
|
-
value: "test4",
|
|
31
|
-
},
|
|
32
|
-
]
|
|
33
|
-
let options2: array<Toolkit__Ui_MultiSelect.item> = [
|
|
34
|
-
{
|
|
35
|
-
itemLabel: <p> {"test4"->React.string} </p>,
|
|
36
|
-
label: "Test4",
|
|
37
|
-
value: "test4",
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
let tmp = Toolkit__Hooks.useDisclosure()
|
|
42
|
-
|
|
43
|
-
let options = tmp.isOpen ? options2 : options1
|
|
44
|
-
|
|
45
|
-
<div>
|
|
46
|
-
<Toolkit__Ui_Button onClick={_ => tmp.toggle()}>
|
|
47
|
-
{"Change options"->React.string}
|
|
48
|
-
</Toolkit__Ui_Button>
|
|
49
|
-
<div className="h-10" />
|
|
50
|
-
<Toolkit__Ui_MultiSelect
|
|
51
|
-
searchPlaceholder="Filter"
|
|
52
|
-
buttonClassName={"w-48"}
|
|
53
|
-
dropdownClassName="w-60"
|
|
54
|
-
placeholder={<span> {"Select me"->React.string} </span>}
|
|
55
|
-
onChange={Js.log}
|
|
56
|
-
options
|
|
57
|
-
/>
|
|
58
|
-
<div className="mt-8" />
|
|
59
|
-
<Toolkit__Ui_MultiSelect
|
|
60
|
-
searchPlaceholder="Filter"
|
|
61
|
-
buttonClassName={"w-48"}
|
|
62
|
-
dropdownClassName="w-60"
|
|
63
|
-
defaultValue={options}
|
|
64
|
-
placeholder={<span> {"Select me"->React.string} </span>}
|
|
65
|
-
onChange={Js.log}
|
|
66
|
-
options
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
example->CSF.addMeta(
|
|
72
|
-
~name="example",
|
|
73
|
-
~parameters={
|
|
74
|
-
"docs": {
|
|
75
|
-
"page": () => <>
|
|
76
|
-
<CodeBlock> source </CodeBlock>
|
|
77
|
-
<Docs.Source
|
|
78
|
-
language="rescript"
|
|
79
|
-
code=j`
|
|
80
|
-
let options: array<Toolkit__Ui_MultiSelect.item> = [
|
|
81
|
-
{
|
|
82
|
-
itemLabel: <p className="flex flex-row text-danger-500">
|
|
83
|
-
<BsReactIcons.FaAngleDown /> {"test"->React.string}
|
|
84
|
-
</p>,
|
|
85
|
-
label: "Test",
|
|
86
|
-
value: "test",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
itemLabel: <p> {"test2"->React.string} </p>,
|
|
90
|
-
label: "Test2",
|
|
91
|
-
value: "test2",
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
itemLabel: <p> {"test3"->React.string} </p>,
|
|
95
|
-
label: "Test3",
|
|
96
|
-
value: "test3",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
itemLabel: <p> {"test4"->React.string} </p>,
|
|
100
|
-
label: "Test4",
|
|
101
|
-
value: "test4",
|
|
102
|
-
},
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
<div>
|
|
106
|
-
<Toolkit__Ui_MultiSelect
|
|
107
|
-
searchPlaceholder="Filter"
|
|
108
|
-
buttonClassName={"w-48"}
|
|
109
|
-
dropdownClassName="w-60"
|
|
110
|
-
placeholder={<span> {"Select me"->React.string} </span>}
|
|
111
|
-
onChange={Js.log}
|
|
112
|
-
options
|
|
113
|
-
/>
|
|
114
|
-
<div className="mt-8" />
|
|
115
|
-
<Toolkit__Ui_MultiSelect
|
|
116
|
-
searchPlaceholder="Filter"
|
|
117
|
-
buttonClassName={"w-48"}
|
|
118
|
-
dropdownClassName="w-60"
|
|
119
|
-
defaultValue={[options[0]->Option.getUnsafe]}
|
|
120
|
-
placeholder={<span> {"Select me"->React.string} </span>}
|
|
121
|
-
onChange={Js.log}
|
|
122
|
-
options
|
|
123
|
-
/>
|
|
124
|
-
</div>
|
|
125
|
-
`
|
|
126
|
-
/>
|
|
127
|
-
<Docs.Story id="components-multiselect--example" />
|
|
128
|
-
</>,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
(),
|
|
132
|
-
)
|
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
open Storybook
|
|
2
|
-
|
|
3
|
-
@module("!!raw-loader!../../../src/ui/Toolkit__Ui_Button.resi")
|
|
4
|
-
external source: 'a = "default"
|
|
5
|
-
|
|
6
|
-
let default = CSF.make(~title="Components/Button", ())
|
|
7
|
-
|
|
8
|
-
let defaultPalette = () => {
|
|
9
|
-
let colors = Js.Dict.fromArray([
|
|
10
|
-
("primary", #primary),
|
|
11
|
-
("black", #black),
|
|
12
|
-
("white", #white),
|
|
13
|
-
("gray", #gray),
|
|
14
|
-
("success", #success),
|
|
15
|
-
("info", #info),
|
|
16
|
-
("danger", #danger),
|
|
17
|
-
("warning", #warning),
|
|
18
|
-
("neutral", #neutral),
|
|
19
|
-
("neutralLight", #neutralLight),
|
|
20
|
-
])
|
|
21
|
-
|
|
22
|
-
let sizes = Js.Dict.fromArray([("xs", #xs), ("sm", #sm), ("md", #md), ("lg", #lg)])
|
|
23
|
-
|
|
24
|
-
<div>
|
|
25
|
-
{colors
|
|
26
|
-
->Js.Dict.entries
|
|
27
|
-
->Array.mapWithIndex((i, (colorText, color)) =>
|
|
28
|
-
<div
|
|
29
|
-
key={i->Int.toString ++ colorText}
|
|
30
|
-
className="flex flex-row flex-col-gap-4 mb-4 items-center">
|
|
31
|
-
<strong className="w-40"> {colorText->React.string} </strong>
|
|
32
|
-
<div className="flex flex-col">
|
|
33
|
-
{[false, true]
|
|
34
|
-
->Array.mapWithIndex((j, disabled) =>
|
|
35
|
-
<div className="flex items-center flex-col-gap-1 mb-2">
|
|
36
|
-
{sizes
|
|
37
|
-
->Js.Dict.entries
|
|
38
|
-
->Array.mapWithIndex((k, (sizeText, size)) =>
|
|
39
|
-
<div key={(i + j + k)->Int.toString ++ (colorText ++ sizeText)}>
|
|
40
|
-
<Toolkit__Ui_Button color size disabled>
|
|
41
|
-
{"hello"->React.string}
|
|
42
|
-
</Toolkit__Ui_Button>
|
|
43
|
-
</div>
|
|
44
|
-
)
|
|
45
|
-
->React.array}
|
|
46
|
-
</div>
|
|
47
|
-
)
|
|
48
|
-
->React.array}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
)
|
|
52
|
-
->React.array}
|
|
53
|
-
</div>
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
defaultPalette->CSF.addMeta(
|
|
57
|
-
~name="default palette",
|
|
58
|
-
~parameters={
|
|
59
|
-
"docs": {
|
|
60
|
-
"page": () => <>
|
|
61
|
-
<Docs.Title />
|
|
62
|
-
<CodeBlock> source </CodeBlock>
|
|
63
|
-
<Docs.Source
|
|
64
|
-
language="rescript"
|
|
65
|
-
code=j`
|
|
66
|
-
<Button variant=#default>"Content"->React.string</Button>
|
|
67
|
-
`
|
|
68
|
-
/>
|
|
69
|
-
</>,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
(),
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
let pillPalette = () => {
|
|
76
|
-
let colors = Js.Dict.fromArray([
|
|
77
|
-
("primary", #primary),
|
|
78
|
-
("black", #black),
|
|
79
|
-
("white", #white),
|
|
80
|
-
("gray", #gray),
|
|
81
|
-
("success", #success),
|
|
82
|
-
("info", #info),
|
|
83
|
-
("danger", #danger),
|
|
84
|
-
("warning", #warning),
|
|
85
|
-
("neutral", #neutral),
|
|
86
|
-
("neutralLight", #neutralLight),
|
|
87
|
-
])
|
|
88
|
-
|
|
89
|
-
let sizes = Js.Dict.fromArray([("xs", #xs), ("sm", #sm), ("md", #md), ("lg", #lg)])
|
|
90
|
-
|
|
91
|
-
<div>
|
|
92
|
-
{colors
|
|
93
|
-
->Js.Dict.entries
|
|
94
|
-
->Array.mapWithIndex((i, (colorText, color)) =>
|
|
95
|
-
<div
|
|
96
|
-
key={i->Int.toString ++ colorText}
|
|
97
|
-
className="flex flex-row flex-col-gap-4 mb-4 items-center">
|
|
98
|
-
<strong className="w-40"> {colorText->React.string} </strong>
|
|
99
|
-
<div className="flex flex-col">
|
|
100
|
-
{[false, true]
|
|
101
|
-
->Array.mapWithIndex((j, disabled) =>
|
|
102
|
-
<div className="flex items-center flex-col-gap-1 mb-2">
|
|
103
|
-
{sizes
|
|
104
|
-
->Js.Dict.entries
|
|
105
|
-
->Array.mapWithIndex((k, (sizeText, size)) =>
|
|
106
|
-
<div key={(i + j + k)->Int.toString ++ (colorText ++ sizeText)}>
|
|
107
|
-
<Toolkit__Ui_Button variant=#pill color size disabled>
|
|
108
|
-
{"hello"->React.string}
|
|
109
|
-
</Toolkit__Ui_Button>
|
|
110
|
-
</div>
|
|
111
|
-
)
|
|
112
|
-
->React.array}
|
|
113
|
-
</div>
|
|
114
|
-
)
|
|
115
|
-
->React.array}
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
)
|
|
119
|
-
->React.array}
|
|
120
|
-
</div>
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
pillPalette->CSF.addMeta(
|
|
124
|
-
~name="pill palette",
|
|
125
|
-
~parameters={
|
|
126
|
-
"docs": {
|
|
127
|
-
"page": () => <>
|
|
128
|
-
<Docs.Title />
|
|
129
|
-
<CodeBlock> source </CodeBlock>
|
|
130
|
-
<Docs.Source
|
|
131
|
-
language="rescript"
|
|
132
|
-
code=j`
|
|
133
|
-
<Button variant=#pill>"Content"->React.string</Button>
|
|
134
|
-
`
|
|
135
|
-
/>
|
|
136
|
-
</>,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
(),
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
let outlinePalette = () => {
|
|
143
|
-
let colors = Js.Dict.fromArray([
|
|
144
|
-
("primary", #primary),
|
|
145
|
-
("black", #black),
|
|
146
|
-
("white", #white),
|
|
147
|
-
("gray", #gray),
|
|
148
|
-
("success", #success),
|
|
149
|
-
("info", #info),
|
|
150
|
-
("danger", #danger),
|
|
151
|
-
("warning", #warning),
|
|
152
|
-
("neutral", #neutral),
|
|
153
|
-
("neutralLight", #neutralLight),
|
|
154
|
-
])
|
|
155
|
-
|
|
156
|
-
let sizes = Js.Dict.fromArray([("xs", #xs), ("sm", #sm), ("md", #md), ("lg", #lg)])
|
|
157
|
-
<div>
|
|
158
|
-
{colors
|
|
159
|
-
->Js.Dict.entries
|
|
160
|
-
->Array.mapWithIndex((i, (colorText, color)) =>
|
|
161
|
-
<div
|
|
162
|
-
key={i->Int.toString ++ colorText}
|
|
163
|
-
className="flex flex-row flex-col-gap-4 mb-4 items-center">
|
|
164
|
-
<strong className="w-40"> {colorText->React.string} </strong>
|
|
165
|
-
<div className="flex flex-col">
|
|
166
|
-
{[false, true]
|
|
167
|
-
->Array.mapWithIndex((j, disabled) =>
|
|
168
|
-
<div className="flex items-center flex-col-gap-1 mb-2">
|
|
169
|
-
{sizes
|
|
170
|
-
->Js.Dict.entries
|
|
171
|
-
->Array.mapWithIndex((k, (sizeText, size)) =>
|
|
172
|
-
<div key={(i + j + k)->Int.toString ++ (colorText ++ sizeText)}>
|
|
173
|
-
<Toolkit__Ui_Button color size disabled variant=#outline>
|
|
174
|
-
{"hello"->React.string}
|
|
175
|
-
</Toolkit__Ui_Button>
|
|
176
|
-
</div>
|
|
177
|
-
)
|
|
178
|
-
->React.array}
|
|
179
|
-
</div>
|
|
180
|
-
)
|
|
181
|
-
->React.array}
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
)
|
|
185
|
-
->React.array}
|
|
186
|
-
</div>
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
outlinePalette->CSF.addMeta(
|
|
190
|
-
~name="outline palette",
|
|
191
|
-
~parameters={
|
|
192
|
-
"docs": {
|
|
193
|
-
"page": () => <>
|
|
194
|
-
<Docs.Title />
|
|
195
|
-
<CodeBlock> source </CodeBlock>
|
|
196
|
-
<Docs.Source
|
|
197
|
-
language="rescript"
|
|
198
|
-
code=j`
|
|
199
|
-
<Button color=#primary variant=#outline>"Content"->React.string</Button>
|
|
200
|
-
`
|
|
201
|
-
/>
|
|
202
|
-
<Toolkit__Ui_Button color=#primary variant=#outline>
|
|
203
|
-
{"hello"->React.string}
|
|
204
|
-
</Toolkit__Ui_Button>
|
|
205
|
-
</>,
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
(),
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
let textPalette = () => {
|
|
212
|
-
let colors = Js.Dict.fromArray([
|
|
213
|
-
("primary", #primary),
|
|
214
|
-
("black", #black),
|
|
215
|
-
("white", #white),
|
|
216
|
-
("gray", #gray),
|
|
217
|
-
("success", #success),
|
|
218
|
-
("info", #info),
|
|
219
|
-
("danger", #danger),
|
|
220
|
-
("warning", #warning),
|
|
221
|
-
("neutral", #neutral),
|
|
222
|
-
("neutralLight", #neutralLight),
|
|
223
|
-
])
|
|
224
|
-
|
|
225
|
-
let sizes = Js.Dict.fromArray([("xs", #xs), ("sm", #sm), ("md", #md), ("lg", #lg)])
|
|
226
|
-
<div>
|
|
227
|
-
{colors
|
|
228
|
-
->Js.Dict.entries
|
|
229
|
-
->Array.mapWithIndex((i, (colorText, color)) =>
|
|
230
|
-
<div
|
|
231
|
-
key={i->Int.toString ++ colorText}
|
|
232
|
-
className="flex flex-row flex-col-gap-4 mb-4 items-center">
|
|
233
|
-
<strong className="w-40"> {colorText->React.string} </strong>
|
|
234
|
-
<div className="flex flex-col">
|
|
235
|
-
{[false, true]
|
|
236
|
-
->Array.mapWithIndex((j, disabled) =>
|
|
237
|
-
<div className="flex items-center flex-col-gap-1 mb-2">
|
|
238
|
-
{sizes
|
|
239
|
-
->Js.Dict.entries
|
|
240
|
-
->Array.mapWithIndex((k, (sizeText, size)) =>
|
|
241
|
-
<div key={(i + j + k)->Int.toString ++ (colorText ++ sizeText)}>
|
|
242
|
-
<Toolkit__Ui_Button color size disabled variant=#text>
|
|
243
|
-
{"hello"->React.string}
|
|
244
|
-
</Toolkit__Ui_Button>
|
|
245
|
-
</div>
|
|
246
|
-
)
|
|
247
|
-
->React.array}
|
|
248
|
-
</div>
|
|
249
|
-
)
|
|
250
|
-
->React.array}
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
253
|
-
)
|
|
254
|
-
->React.array}
|
|
255
|
-
</div>
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
textPalette->CSF.addMeta(
|
|
259
|
-
~name="text palette",
|
|
260
|
-
~parameters={
|
|
261
|
-
"docs": {
|
|
262
|
-
"page": () => <>
|
|
263
|
-
<Docs.Title />
|
|
264
|
-
<CodeBlock> source </CodeBlock>
|
|
265
|
-
<Docs.Source
|
|
266
|
-
language="rescript"
|
|
267
|
-
code=j`
|
|
268
|
-
<Button color=#primary variant=#text>"Content"->React.string</Button>
|
|
269
|
-
`
|
|
270
|
-
/>
|
|
271
|
-
<Toolkit__Ui_Button color=#primary variant=#text>
|
|
272
|
-
{"hello"->React.string}
|
|
273
|
-
</Toolkit__Ui_Button>
|
|
274
|
-
</>,
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
(),
|
|
278
|
-
)
|
|
279
|
-
|
|
280
|
-
let loading = () =>
|
|
281
|
-
<Toolkit__Ui_Button color=#primary isLoading=true> {"content"->React.string} </Toolkit__Ui_Button>
|
|
282
|
-
|
|
283
|
-
loading->CSF.addMeta(
|
|
284
|
-
~name="loading",
|
|
285
|
-
~parameters={
|
|
286
|
-
"docs": {
|
|
287
|
-
"page": () => <>
|
|
288
|
-
<Docs.Title />
|
|
289
|
-
<CodeBlock> source </CodeBlock>
|
|
290
|
-
<Docs.Source
|
|
291
|
-
language="rescript"
|
|
292
|
-
code=j`
|
|
293
|
-
<Button color=#primary isLoading=true>"Content"->React.string</Button>
|
|
294
|
-
`
|
|
295
|
-
/>
|
|
296
|
-
<Docs.Story id="components-button--loading" />
|
|
297
|
-
</>,
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
(),
|
|
301
|
-
)
|
|
302
|
-
|
|
303
|
-
let disabled = () =>
|
|
304
|
-
<Toolkit__Ui_Button color=#primary disabled=true> {"content"->React.string} </Toolkit__Ui_Button>
|
|
305
|
-
|
|
306
|
-
disabled->CSF.addMeta(
|
|
307
|
-
~name="disabled",
|
|
308
|
-
~parameters={
|
|
309
|
-
"docs": {
|
|
310
|
-
"page": () => <>
|
|
311
|
-
<Docs.Title />
|
|
312
|
-
<CodeBlock> source </CodeBlock>
|
|
313
|
-
<Docs.Source
|
|
314
|
-
language="rescript"
|
|
315
|
-
code=j`
|
|
316
|
-
<Button color=#primary disabled=true>"Content"->React.string</Button>
|
|
317
|
-
`
|
|
318
|
-
/>
|
|
319
|
-
<Docs.Story id="components-button--disabled" />
|
|
320
|
-
</>,
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
(),
|
|
324
|
-
)
|