@bricks-toolkit/toolkit 0.1.1 → 0.1.2
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/README.md +9 -9
- package/dist/avatar/index.cjs +11 -1
- package/dist/avatar/index.mjs +2 -1
- package/dist/badge/index.cjs +11 -1
- package/dist/badge/index.mjs +2 -1
- package/dist/breadcrumbs/index.cjs +11 -1
- package/dist/breadcrumbs/index.mjs +2 -1
- package/dist/button/index.cjs +13 -2
- package/dist/button/index.mjs +4 -2
- package/dist/card/index.cjs +31 -1
- package/dist/card/index.mjs +2 -1
- package/dist/checkbox/index.cjs +11 -1
- package/dist/checkbox/index.mjs +2 -1
- package/dist/chunk-2POU3NX4.mjs +192 -0
- package/dist/chunk-32SKYPQW.mjs +156 -0
- package/dist/chunk-446OJWC6.mjs +285 -0
- package/dist/chunk-4DA7CRNV.mjs +376 -0
- package/dist/chunk-4DR57X7U.mjs +182 -0
- package/dist/chunk-4QSDPHPI.mjs +285 -0
- package/dist/chunk-56ILK7Y4.cjs +315 -0
- package/dist/chunk-5J3OMAO4.cjs +222 -0
- package/dist/chunk-5RKET2JO.cjs +287 -0
- package/dist/chunk-65UZC3FK.mjs +312 -0
- package/dist/chunk-6CC5KIA5.cjs +148 -0
- package/dist/chunk-6R3OYBQ6.cjs +209 -0
- package/dist/chunk-6UO72EJA.cjs +2 -0
- package/dist/chunk-6ZCY4O5M.mjs +63 -0
- package/dist/chunk-7364SUK6.mjs +359 -0
- package/dist/chunk-7DDDQ3RH.cjs +66 -0
- package/dist/chunk-7PDGAIC3.cjs +189 -0
- package/dist/chunk-7R5JRJ2W.cjs +255 -0
- package/dist/chunk-7WNJ7L4Z.mjs +335 -0
- package/dist/chunk-AJXVELXK.cjs +218 -0
- package/dist/chunk-ARTXRQO6.mjs +1 -0
- package/dist/chunk-B4OV5GRT.cjs +510 -0
- package/dist/chunk-B5MYGYJY.mjs +122 -0
- package/dist/chunk-BBVWG5GH.cjs +75 -0
- package/dist/chunk-BVBCAAES.mjs +35 -0
- package/dist/chunk-CBA54EY4.mjs +508 -0
- package/dist/chunk-CMER5LO3.mjs +330 -0
- package/dist/chunk-DHC5LI2P.cjs +338 -0
- package/dist/chunk-DMLPA65B.mjs +107 -0
- package/dist/chunk-DN2GFJF4.mjs +175 -0
- package/dist/chunk-ECLNLPOR.cjs +70 -0
- package/dist/chunk-EV463QT5.cjs +53 -0
- package/dist/chunk-FOVJHEWH.mjs +51 -0
- package/dist/chunk-G4HVY6FM.mjs +203 -0
- package/dist/chunk-H77YWN3L.mjs +220 -0
- package/dist/chunk-HIWJDLIS.cjs +124 -0
- package/dist/chunk-HQGDSOSN.mjs +274 -0
- package/dist/chunk-JKPNJ4PZ.mjs +313 -0
- package/dist/chunk-JV6AWBN5.mjs +113 -0
- package/dist/chunk-KA35BV7V.mjs +207 -0
- package/dist/chunk-KLBABQEJ.cjs +378 -0
- package/dist/chunk-L5VQZZVR.cjs +3197 -0
- package/dist/chunk-LTG6YP5I.cjs +69 -0
- package/dist/chunk-MVUNJPGH.cjs +184 -0
- package/dist/chunk-NMJ5CVZH.cjs +2 -0
- package/dist/chunk-NRCNRHXL.cjs +109 -0
- package/dist/chunk-NRZIXK35.cjs +276 -0
- package/dist/chunk-OCPFOFJ4.mjs +3195 -0
- package/dist/chunk-OEU5VG3D.cjs +362 -0
- package/dist/chunk-OPOCCRJG.cjs +193 -0
- package/dist/chunk-OQPCL5XX.mjs +187 -0
- package/dist/chunk-PCYGJNEQ.cjs +280 -0
- package/dist/chunk-PJH2KEWK.mjs +200 -0
- package/dist/chunk-PJWELBN2.cjs +115 -0
- package/dist/chunk-Q3IFXFFD.cjs +202 -0
- package/dist/chunk-R72GDCWE.cjs +314 -0
- package/dist/chunk-RAD5VJHR.mjs +146 -0
- package/dist/chunk-RYWDZHKG.mjs +274 -0
- package/dist/chunk-S7VEND5Z.cjs +162 -0
- package/dist/chunk-SBNNV6FE.mjs +1 -0
- package/dist/chunk-SFUOCZJY.mjs +187 -0
- package/dist/chunk-SHQ2MPBE.mjs +73 -0
- package/dist/chunk-TIVSMCXZ.mjs +253 -0
- package/dist/chunk-TNGW5YHA.cjs +37 -0
- package/dist/chunk-VC7MOPU6.cjs +287 -0
- package/dist/chunk-VHVFRWF5.mjs +64 -0
- package/dist/chunk-VKQDW7C2.mjs +336 -0
- package/dist/chunk-VRZFAKSV.cjs +177 -0
- package/dist/chunk-W2ZAPLQH.cjs +337 -0
- package/dist/chunk-XFNRKHHF.cjs +332 -0
- package/dist/chunk-Y3NTKFUE.mjs +66 -0
- package/dist/chunk-Y6AN7AWX.cjs +205 -0
- package/dist/chunk-YMMNWJT6.cjs +134 -0
- package/dist/chunk-YOTCXSXL.mjs +132 -0
- package/dist/combo-box/index.cjs +11 -1
- package/dist/combo-box/index.mjs +2 -1
- package/dist/date-picker/index.cjs +11 -2
- package/dist/date-picker/index.mjs +2 -2
- package/dist/dialog/index.cjs +27 -1
- package/dist/dialog/index.mjs +2 -1
- package/dist/dropdown-menu/index.cjs +27 -1
- package/dist/dropdown-menu/index.mjs +2 -1
- package/dist/email/index.cjs +11 -2
- package/dist/email/index.mjs +2 -2
- package/dist/file-upload/index.cjs +11 -1
- package/dist/file-upload/index.mjs +2 -1
- package/dist/header/index.cjs +14 -2
- package/dist/header/index.mjs +5 -2
- package/dist/icon-button/index.cjs +13 -2
- package/dist/icon-button/index.mjs +4 -2
- package/dist/image/index.cjs +12 -1
- package/dist/image/index.mjs +3 -1
- package/dist/index.cjs +839 -2
- package/dist/index.d.ts +141 -75
- package/dist/index.mjs +601 -2
- package/dist/link/index.cjs +11 -1
- package/dist/link/index.mjs +2 -1
- package/dist/loader/index.cjs +11 -2
- package/dist/loader/index.mjs +2 -2
- package/dist/modal/index.cjs +27 -1
- package/dist/modal/index.mjs +2 -1
- package/dist/multi-select/index.cjs +11 -2
- package/dist/multi-select/index.mjs +2 -2
- package/dist/otp-input/index.cjs +11 -1
- package/dist/otp-input/index.mjs +2 -1
- package/dist/password-input/index.cjs +11 -2
- package/dist/password-input/index.mjs +2 -2
- package/dist/phone/index.cjs +11 -2
- package/dist/phone/index.mjs +2 -2
- package/dist/radio-button/index.cjs +11 -1
- package/dist/radio-button/index.mjs +2 -1
- package/dist/search-input/index.cjs +12 -2
- package/dist/search-input/index.mjs +3 -2
- package/dist/select/index.cjs +11 -2
- package/dist/select/index.mjs +2 -2
- package/dist/sidebar/index.cjs +11 -1
- package/dist/sidebar/index.mjs +2 -1
- package/dist/skeleton/index.cjs +27 -1
- package/dist/skeleton/index.mjs +2 -1
- package/dist/styles.css +5074 -1
- package/dist/table/index.cjs +15 -1
- package/dist/table/index.mjs +2 -1
- package/dist/tabs/index.cjs +14 -2
- package/dist/tabs/index.mjs +5 -2
- package/dist/text-input/index.cjs +11 -2
- package/dist/text-input/index.mjs +2 -2
- package/dist/theme-provider/index.cjs +14 -1
- package/dist/theme-provider/index.mjs +1 -1
- package/dist/time-picker/index.cjs +11 -2
- package/dist/time-picker/index.mjs +2 -2
- package/dist/toaster/index.cjs +11 -1
- package/dist/toaster/index.mjs +2 -1
- package/dist/tooltip/index.cjs +12 -1
- package/dist/tooltip/index.mjs +3 -1
- package/package.json +122 -141
- package/dist/components/Accordion/Accordion.d.ts +0 -5
- package/dist/components/Accordion/Accordion.types.d.ts +0 -32
- package/dist/components/Accordion/index.d.ts +0 -2
- package/dist/components/Avatar/Avatar.d.ts +0 -2
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -11
- package/dist/components/Avatar/Avatar.test.d.ts +0 -1
- package/dist/components/Avatar/Avatar.types.d.ts +0 -24
- package/dist/components/Avatar/index.d.ts +0 -2
- package/dist/components/Badge/Badge.d.ts +0 -11
- package/dist/components/Badge/Badge.stories.d.ts +0 -21
- package/dist/components/Badge/Badge.test.d.ts +0 -1
- package/dist/components/Badge/Badge.types.d.ts +0 -43
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.test.d.ts +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +0 -27
- package/dist/components/Breadcrumbs/index.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.stories.d.ts +0 -20
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/Button.types.d.ts +0 -24
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Card/Card.d.ts +0 -25
- package/dist/components/Card/Card.stories.d.ts +0 -8
- package/dist/components/Card/Card.test.d.ts +0 -1
- package/dist/components/Card/Card.types.d.ts +0 -14
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/Checkbox/Checkbox.d.ts +0 -2
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -16
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.types.d.ts +0 -31
- package/dist/components/Checkbox/index.d.ts +0 -2
- package/dist/components/ComboBox/ComboBox.d.ts +0 -2
- package/dist/components/ComboBox/ComboBox.stories.d.ts +0 -12
- package/dist/components/ComboBox/ComboBox.test.d.ts +0 -1
- package/dist/components/ComboBox/ComboBox.types.d.ts +0 -57
- package/dist/components/ComboBox/index.d.ts +0 -2
- package/dist/components/DatePicker/DatePicker.d.ts +0 -2
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -25
- package/dist/components/DatePicker/DatePicker.test.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.types.d.ts +0 -27
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/Dialog/Dialog.d.ts +0 -6
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -9
- package/dist/components/Dialog/Dialog.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.types.d.ts +0 -52
- package/dist/components/Dialog/index.d.ts +0 -2
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -7
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +0 -9
- package/dist/components/DropdownMenu/DropdownMenu.test.d.ts +0 -1
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +0 -24
- package/dist/components/DropdownMenu/index.d.ts +0 -2
- package/dist/components/Email/Email.d.ts +0 -2
- package/dist/components/Email/Email.stories.d.ts +0 -11
- package/dist/components/Email/Email.test.d.ts +0 -1
- package/dist/components/Email/Email.types.d.ts +0 -33
- package/dist/components/Email/index.d.ts +0 -2
- package/dist/components/FileUpload/FileUpload.d.ts +0 -2
- package/dist/components/FileUpload/FileUpload.stories.d.ts +0 -10
- package/dist/components/FileUpload/FileUpload.test.d.ts +0 -1
- package/dist/components/FileUpload/FileUpload.types.d.ts +0 -22
- package/dist/components/FileUpload/index.d.ts +0 -2
- package/dist/components/Header/Header.d.ts +0 -7
- package/dist/components/Header/Header.stories.d.ts +0 -8
- package/dist/components/Header/Header.test.d.ts +0 -1
- package/dist/components/Header/Header.types.d.ts +0 -19
- package/dist/components/Header/index.d.ts +0 -2
- package/dist/components/IconButton/IconButton.d.ts +0 -2
- package/dist/components/IconButton/IconButton.stories.d.ts +0 -17
- package/dist/components/IconButton/IconButton.types.d.ts +0 -10
- package/dist/components/IconButton/index.d.ts +0 -2
- package/dist/components/Image/Image.d.ts +0 -6
- package/dist/components/Image/Image.stories.d.ts +0 -13
- package/dist/components/Image/Image.test.d.ts +0 -1
- package/dist/components/Image/Image.types.d.ts +0 -40
- package/dist/components/Image/index.d.ts +0 -2
- package/dist/components/Link/Link.d.ts +0 -2
- package/dist/components/Link/Link.stories.d.ts +0 -15
- package/dist/components/Link/Link.test.d.ts +0 -1
- package/dist/components/Link/Link.types.d.ts +0 -20
- package/dist/components/Link/index.d.ts +0 -2
- package/dist/components/Loader/Loader.d.ts +0 -2
- package/dist/components/Loader/Loader.stories.d.ts +0 -12
- package/dist/components/Loader/Loader.test.d.ts +0 -1
- package/dist/components/Loader/Loader.types.d.ts +0 -17
- package/dist/components/Loader/index.d.ts +0 -2
- package/dist/components/Modal/Modal.d.ts +0 -14
- package/dist/components/Modal/Modal.stories.d.ts +0 -14
- package/dist/components/Modal/Modal.test.d.ts +0 -1
- package/dist/components/Modal/Modal.types.d.ts +0 -100
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -2
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -15
- package/dist/components/MultiSelect/MultiSelect.test.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +0 -55
- package/dist/components/MultiSelect/index.d.ts +0 -2
- package/dist/components/OtpInput/OtpInput.d.ts +0 -2
- package/dist/components/OtpInput/OtpInput.stories.d.ts +0 -10
- package/dist/components/OtpInput/OtpInput.test.d.ts +0 -1
- package/dist/components/OtpInput/OtpInput.types.d.ts +0 -53
- package/dist/components/OtpInput/index.d.ts +0 -2
- package/dist/components/PasswordInput/PasswordInput.d.ts +0 -2
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts +0 -23
- package/dist/components/PasswordInput/PasswordInput.test.d.ts +0 -1
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +0 -27
- package/dist/components/PasswordInput/index.d.ts +0 -2
- package/dist/components/Phone/Phone.d.ts +0 -2
- package/dist/components/Phone/Phone.stories.d.ts +0 -11
- package/dist/components/Phone/Phone.test.d.ts +0 -1
- package/dist/components/Phone/Phone.types.d.ts +0 -36
- package/dist/components/Phone/countries.d.ts +0 -8
- package/dist/components/Phone/index.d.ts +0 -2
- package/dist/components/RadioButton/RadioButton.d.ts +0 -2
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -21
- package/dist/components/RadioButton/RadioButton.test.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.types.d.ts +0 -51
- package/dist/components/RadioButton/index.d.ts +0 -2
- package/dist/components/SearchInput/SearchInput.d.ts +0 -6
- package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -8
- package/dist/components/SearchInput/SearchInput.test.d.ts +0 -1
- package/dist/components/SearchInput/SearchInput.types.d.ts +0 -12
- package/dist/components/SearchInput/index.d.ts +0 -2
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/Select.stories.d.ts +0 -12
- package/dist/components/Select/Select.test.d.ts +0 -1
- package/dist/components/Select/Select.types.d.ts +0 -31
- package/dist/components/Select/index.d.ts +0 -2
- package/dist/components/Sidebar/Sidebar.d.ts +0 -7
- package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -10
- package/dist/components/Sidebar/Sidebar.test.d.ts +0 -1
- package/dist/components/Sidebar/Sidebar.types.d.ts +0 -87
- package/dist/components/Sidebar/index.d.ts +0 -2
- package/dist/components/Skeleton/Skeleton.d.ts +0 -26
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -13
- package/dist/components/Skeleton/Skeleton.types.d.ts +0 -47
- package/dist/components/Skeleton/index.d.ts +0 -2
- package/dist/components/Stepper/Stepper.d.ts +0 -2
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -23
- package/dist/components/Stepper/Stepper.test.d.ts +0 -1
- package/dist/components/Stepper/Stepper.types.d.ts +0 -47
- package/dist/components/Stepper/index.d.ts +0 -2
- package/dist/components/Table/Pagination.d.ts +0 -3
- package/dist/components/Table/Table.d.ts +0 -3
- package/dist/components/Table/Table.stories.d.ts +0 -13
- package/dist/components/Table/Table.test.d.ts +0 -1
- package/dist/components/Table/Table.types.d.ts +0 -85
- package/dist/components/Table/index.d.ts +0 -3
- package/dist/components/Tabs/Tabs.d.ts +0 -2
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -17
- package/dist/components/Tabs/Tabs.test.d.ts +0 -1
- package/dist/components/Tabs/Tabs.types.d.ts +0 -21
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/TextInput/TextInput.d.ts +0 -2
- package/dist/components/TextInput/TextInput.stories.d.ts +0 -25
- package/dist/components/TextInput/TextInput.test.d.ts +0 -1
- package/dist/components/TextInput/TextInput.types.d.ts +0 -29
- package/dist/components/TextInput/index.d.ts +0 -2
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -8
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +0 -16
- package/dist/components/ThemeProvider/ThemeProvider.test.d.ts +0 -1
- package/dist/components/ThemeProvider/ThemeProvider.types.d.ts +0 -112
- package/dist/components/ThemeProvider/index.d.ts +0 -2
- package/dist/components/TimePicker/TimePicker.d.ts +0 -2
- package/dist/components/TimePicker/TimePicker.stories.d.ts +0 -23
- package/dist/components/TimePicker/TimePicker.test.d.ts +0 -1
- package/dist/components/TimePicker/TimePicker.types.d.ts +0 -27
- package/dist/components/TimePicker/index.d.ts +0 -2
- package/dist/components/Toaster/Toaster.d.ts +0 -2
- package/dist/components/Toaster/Toaster.stories.d.ts +0 -13
- package/dist/components/Toaster/Toaster.test.d.ts +0 -1
- package/dist/components/Toaster/Toaster.types.d.ts +0 -23
- package/dist/components/Toaster/index.d.ts +0 -2
- package/dist/components/Toggle/Toggle.d.ts +0 -2
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -11
- package/dist/components/Toggle/Toggle.types.d.ts +0 -10
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -13
- package/dist/components/Tooltip/Tooltip.test.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +0 -33
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bricks
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/bricks)
|
|
4
4
|
[](https://www.typescriptlang.org/)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
# npm
|
|
30
|
-
npm install
|
|
30
|
+
npm install bricks
|
|
31
31
|
|
|
32
32
|
# Or with yarn
|
|
33
|
-
yarn add
|
|
33
|
+
yarn add bricks
|
|
34
34
|
|
|
35
35
|
# Or with pnpm
|
|
36
|
-
pnpm add
|
|
36
|
+
pnpm add bricks
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
**Peer dependencies** (must be installed by the consumer):
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
content: [
|
|
62
62
|
'./src/**/*.{ts,tsx}',
|
|
63
63
|
// Add the library's dist path:
|
|
64
|
-
'./node_modules
|
|
64
|
+
'./node_modules/bricks/dist/**/*.js',
|
|
65
65
|
],
|
|
66
66
|
} satisfies Config
|
|
67
67
|
```
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
72
|
// In your entry file (e.g. main.tsx)
|
|
73
|
-
import '
|
|
73
|
+
import 'bricks/styles.css'
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
---
|
|
@@ -80,7 +80,7 @@ import '@bricks-toolkit/toolkit/styles.css'
|
|
|
80
80
|
### Named import (full bundle)
|
|
81
81
|
|
|
82
82
|
```tsx
|
|
83
|
-
import { TextInput } from '
|
|
83
|
+
import { TextInput } from 'bricks'
|
|
84
84
|
|
|
85
85
|
function App() {
|
|
86
86
|
return (
|
|
@@ -98,7 +98,7 @@ function App() {
|
|
|
98
98
|
### Sub-path import (tree-shakeable)
|
|
99
99
|
|
|
100
100
|
```tsx
|
|
101
|
-
import { TextInput } from '
|
|
101
|
+
import { TextInput } from 'bricks/text-input'
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
---
|
|
@@ -134,7 +134,7 @@ import { TextInput } from '@bricks-toolkit/toolkit/text-input'
|
|
|
134
134
|
### Exported Types
|
|
135
135
|
|
|
136
136
|
```ts
|
|
137
|
-
import type { TextInputProps, TextInputVariant, TextInputSize, TextInputState } from '
|
|
137
|
+
import type { TextInputProps, TextInputVariant, TextInputSize, TextInputState } from 'bricks'
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
### Examples
|
package/dist/avatar/index.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHIWJDLIS_cjs = require('../chunk-HIWJDLIS.cjs');
|
|
4
|
+
require('../chunk-L5VQZZVR.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Avatar", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkHIWJDLIS_cjs.Avatar; }
|
|
11
|
+
});
|
package/dist/avatar/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { Avatar } from '../chunk-B5MYGYJY.mjs';
|
|
2
|
+
import '../chunk-OCPFOFJ4.mjs';
|
package/dist/badge/index.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk5J3OMAO4_cjs = require('../chunk-5J3OMAO4.cjs');
|
|
4
|
+
require('../chunk-L5VQZZVR.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Badge", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk5J3OMAO4_cjs.Badge; }
|
|
11
|
+
});
|
package/dist/badge/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { Badge } from '../chunk-H77YWN3L.mjs';
|
|
2
|
+
import '../chunk-OCPFOFJ4.mjs';
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkNRCNRHXL_cjs = require('../chunk-NRCNRHXL.cjs');
|
|
4
|
+
require('../chunk-L5VQZZVR.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Breadcrumbs", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkNRCNRHXL_cjs.Breadcrumbs; }
|
|
11
|
+
});
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { Breadcrumbs } from '../chunk-DMLPA65B.mjs';
|
|
2
|
+
import '../chunk-OCPFOFJ4.mjs';
|
package/dist/button/index.cjs
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-6UO72EJA.cjs');
|
|
4
|
+
var chunk6CC5KIA5_cjs = require('../chunk-6CC5KIA5.cjs');
|
|
5
|
+
require('../chunk-R72GDCWE.cjs');
|
|
6
|
+
require('../chunk-L5VQZZVR.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "Button", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunk6CC5KIA5_cjs.Button; }
|
|
13
|
+
});
|
package/dist/button/index.mjs
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export{
|
|
1
|
+
import '../chunk-ARTXRQO6.mjs';
|
|
2
|
+
export { Button } from '../chunk-RAD5VJHR.mjs';
|
|
3
|
+
import '../chunk-65UZC3FK.mjs';
|
|
4
|
+
import '../chunk-OCPFOFJ4.mjs';
|
package/dist/card/index.cjs
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkECLNLPOR_cjs = require('../chunk-ECLNLPOR.cjs');
|
|
4
|
+
require('../chunk-L5VQZZVR.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Card", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkECLNLPOR_cjs.Card; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CardContent", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkECLNLPOR_cjs.CardContent; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "CardDescription", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkECLNLPOR_cjs.CardDescription; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "CardFooter", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkECLNLPOR_cjs.CardFooter; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "CardHeader", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkECLNLPOR_cjs.CardHeader; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "CardTitle", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkECLNLPOR_cjs.CardTitle; }
|
|
31
|
+
});
|
package/dist/card/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../chunk-6ZCY4O5M.mjs';
|
|
2
|
+
import '../chunk-OCPFOFJ4.mjs';
|
package/dist/checkbox/index.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk7PDGAIC3_cjs = require('../chunk-7PDGAIC3.cjs');
|
|
4
|
+
require('../chunk-L5VQZZVR.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "Checkbox", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk7PDGAIC3_cjs.Checkbox; }
|
|
11
|
+
});
|
package/dist/checkbox/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { Checkbox } from '../chunk-SFUOCZJY.mjs';
|
|
2
|
+
import '../chunk-OCPFOFJ4.mjs';
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { cn } from './chunk-OCPFOFJ4.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ChevronDownIcon } from '@heroicons/react/20/solid';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var DropdownMenuContext = React.createContext(null);
|
|
7
|
+
function useDropdownMenu() {
|
|
8
|
+
const context = React.useContext(DropdownMenuContext);
|
|
9
|
+
if (!context) {
|
|
10
|
+
throw new Error("DropdownMenu components must be used within a DropdownMenu");
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
var DropdownMenu = ({
|
|
15
|
+
children,
|
|
16
|
+
open: controlledOpen,
|
|
17
|
+
onOpenChange,
|
|
18
|
+
className
|
|
19
|
+
}) => {
|
|
20
|
+
const [internalOpen, setInternalOpen] = React.useState(false);
|
|
21
|
+
const [triggerElement, setTriggerElement] = React.useState(null);
|
|
22
|
+
const open = controlledOpen ?? internalOpen;
|
|
23
|
+
const setOpen = React.useCallback(
|
|
24
|
+
(nextOpen) => {
|
|
25
|
+
setInternalOpen(nextOpen);
|
|
26
|
+
onOpenChange?.(nextOpen);
|
|
27
|
+
},
|
|
28
|
+
[onOpenChange]
|
|
29
|
+
);
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (!open) return;
|
|
32
|
+
const handleClickOutside = (event) => {
|
|
33
|
+
if (triggerElement && !triggerElement.contains(event.target) && !event.target.closest("[data-dropdown-content]")) {
|
|
34
|
+
setOpen(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
38
|
+
return () => {
|
|
39
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
40
|
+
};
|
|
41
|
+
}, [open, setOpen, triggerElement]);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (!open) return;
|
|
44
|
+
const handleKeyDown = (event) => {
|
|
45
|
+
if (event.key === "Escape") {
|
|
46
|
+
setOpen(false);
|
|
47
|
+
triggerElement?.focus();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
51
|
+
return () => {
|
|
52
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
53
|
+
};
|
|
54
|
+
}, [open, setOpen, triggerElement]);
|
|
55
|
+
return /* @__PURE__ */ jsx(DropdownMenuContext.Provider, { value: { open, setOpen, triggerElement, setTriggerElement }, children: /* @__PURE__ */ jsx("div", { className: cn("relative inline-block", className), children }) });
|
|
56
|
+
};
|
|
57
|
+
var triggerSizeClasses = {
|
|
58
|
+
sm: "h-8 px-3 text-xs",
|
|
59
|
+
md: "h-10 px-4 text-sm",
|
|
60
|
+
lg: "h-11 px-5 text-base"
|
|
61
|
+
};
|
|
62
|
+
var triggerVariantClasses = {
|
|
63
|
+
default: "bg-surface border border-border text-text shadow-sm hover:bg-hover focus:ring-2 focus:ring-primary/40",
|
|
64
|
+
subtle: "bg-surface-secondary text-text hover:bg-active",
|
|
65
|
+
ghost: "bg-transparent text-text-secondary hover:bg-hover"
|
|
66
|
+
};
|
|
67
|
+
var DropdownMenuTrigger = React.forwardRef(
|
|
68
|
+
({ children, className, size = "md", variant = "default", onClick, ...props }, ref) => {
|
|
69
|
+
const { open, setOpen, setTriggerElement } = useDropdownMenu();
|
|
70
|
+
const setRefs = React.useCallback(
|
|
71
|
+
(node) => {
|
|
72
|
+
setTriggerElement(node);
|
|
73
|
+
if (typeof ref === "function") {
|
|
74
|
+
ref(node);
|
|
75
|
+
} else if (ref) {
|
|
76
|
+
ref.current = node;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
[ref, setTriggerElement]
|
|
80
|
+
);
|
|
81
|
+
const handleClick = (e) => {
|
|
82
|
+
setOpen(!open);
|
|
83
|
+
onClick?.(e);
|
|
84
|
+
};
|
|
85
|
+
const baseClasses = "inline-flex items-center justify-center rounded-md font-bold uppercase tracking-widest transition-all duration-normal focus:outline-none disabled:opacity-50 disabled:pointer-events-none";
|
|
86
|
+
return /* @__PURE__ */ jsxs(
|
|
87
|
+
"button",
|
|
88
|
+
{
|
|
89
|
+
ref: setRefs,
|
|
90
|
+
type: "button",
|
|
91
|
+
"aria-expanded": open,
|
|
92
|
+
"aria-haspopup": "menu",
|
|
93
|
+
className: cn(
|
|
94
|
+
baseClasses,
|
|
95
|
+
triggerSizeClasses[size],
|
|
96
|
+
triggerVariantClasses[variant],
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
onClick: handleClick,
|
|
100
|
+
...props,
|
|
101
|
+
children: [
|
|
102
|
+
children,
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
ChevronDownIcon,
|
|
105
|
+
{
|
|
106
|
+
className: cn("ml-2 h-4 w-4 transition-transform duration-200", open && "rotate-180")
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
var DropdownMenuContent = React.forwardRef(
|
|
115
|
+
({ children, className, align = "left", width = 220, ...props }, ref) => {
|
|
116
|
+
const { open } = useDropdownMenu();
|
|
117
|
+
if (!open) return null;
|
|
118
|
+
const alignClasses = {
|
|
119
|
+
left: "left-0",
|
|
120
|
+
right: "right-0",
|
|
121
|
+
center: "left-1/2 -translate-x-1/2"
|
|
122
|
+
};
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
ref,
|
|
127
|
+
"data-dropdown-content": true,
|
|
128
|
+
role: "menu",
|
|
129
|
+
style: { width },
|
|
130
|
+
className: cn(
|
|
131
|
+
"absolute top-full z-dropdown mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-surface p-1.5 text-text shadow-lg ring-1 ring-border/5 animate-in fade-in zoom-in-95 duration-normal",
|
|
132
|
+
alignClasses[align],
|
|
133
|
+
className
|
|
134
|
+
),
|
|
135
|
+
...props,
|
|
136
|
+
children
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
var DropdownMenuItem = React.forwardRef(
|
|
142
|
+
({ children, className, disabled, destructive, icon, shortcut, onClick, ...props }, ref) => {
|
|
143
|
+
const { setOpen } = useDropdownMenu();
|
|
144
|
+
const handleClick = (e) => {
|
|
145
|
+
if (disabled) return;
|
|
146
|
+
onClick?.(e);
|
|
147
|
+
setOpen(false);
|
|
148
|
+
};
|
|
149
|
+
const handleKeyDown = (e) => {
|
|
150
|
+
if (disabled) return;
|
|
151
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
onClick?.(e);
|
|
154
|
+
setOpen(false);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
return /* @__PURE__ */ jsxs(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
ref,
|
|
161
|
+
role: "menuitem",
|
|
162
|
+
"aria-disabled": disabled,
|
|
163
|
+
tabIndex: disabled ? -1 : 0,
|
|
164
|
+
className: cn(
|
|
165
|
+
"relative flex cursor-default select-none items-center rounded-sm px-3 py-2 text-sm outline-none transition-all duration-fast focus:bg-hover data-disabled:pointer-events-none data-disabled:opacity-50 hover:bg-hover font-medium",
|
|
166
|
+
destructive && "text-error hover:bg-error/10 hover:text-error",
|
|
167
|
+
disabled && "opacity-50 pointer-events-none",
|
|
168
|
+
className
|
|
169
|
+
),
|
|
170
|
+
onClick: handleClick,
|
|
171
|
+
onKeyDown: handleKeyDown,
|
|
172
|
+
...props,
|
|
173
|
+
children: [
|
|
174
|
+
icon && /* @__PURE__ */ jsx("span", { className: "mr-2 flex h-4 w-4 items-center justify-center", children: icon }),
|
|
175
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1", children }),
|
|
176
|
+
shortcut && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs tracking-widest text-text-muted font-bold", children: shortcut })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
var DropdownMenuSeparator = ({
|
|
183
|
+
className,
|
|
184
|
+
...props
|
|
185
|
+
}) => /* @__PURE__ */ jsx("div", { className: cn("-mx-1.5 my-1 h-px bg-divider", className), ...props });
|
|
186
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
187
|
+
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
188
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
189
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
190
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
191
|
+
|
|
192
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger };
|