@kuzenbo/core 0.0.4 → 0.0.6
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 +2 -0
- package/dist/action-icon-UjYZjXrB.d.ts +59 -0
- package/dist/action-icon-UjYZjXrB.d.ts.map +1 -0
- package/dist/{avatar-image-Ce26D2fb.d.ts → avatar-4S7I72CH.d.ts} +35 -2
- package/dist/avatar-4S7I72CH.d.ts.map +1 -0
- package/dist/avatar-C3vF6E7s.js +65 -0
- package/dist/avatar-C3vF6E7s.js.map +1 -0
- package/dist/badge-DB40swlt.js +58 -0
- package/dist/badge-DB40swlt.js.map +1 -0
- package/dist/button-CPPkhcmB.d.ts +59 -0
- package/dist/button-CPPkhcmB.d.ts.map +1 -0
- package/dist/button-shared-variants-J4RVI3K7.js +19 -0
- package/dist/button-shared-variants-J4RVI3K7.js.map +1 -0
- package/dist/{dialog-viewport-Ce1huyAI.d.ts → dialog-D3dAMsO_.d.ts} +64 -2
- package/dist/dialog-D3dAMsO_.d.ts.map +1 -0
- package/dist/{dialog-trigger-BUF3elAP.js → dialog-Dzvma_bu.js} +36 -12
- package/dist/dialog-Dzvma_bu.js.map +1 -0
- package/dist/{dropdown-menu-trigger-BpgtLUvf.d.ts → dropdown-menu-BG03sLbC.d.ts} +259 -123
- package/dist/dropdown-menu-BG03sLbC.d.ts.map +1 -0
- package/dist/{dropdown-menu-trigger-COnFGfDa.js → dropdown-menu-DOVY76ue.js} +137 -101
- package/dist/dropdown-menu-DOVY76ue.js.map +1 -0
- package/dist/input-BeE717GK.d.ts +46 -0
- package/dist/input-BeE717GK.d.ts.map +1 -0
- package/dist/input-cICL6sH_.js +38 -0
- package/dist/input-cICL6sH_.js.map +1 -0
- package/dist/{input-group-textarea-B-rP98r5.js → input-group-7kPror1q.js} +62 -33
- package/dist/input-group-7kPror1q.js.map +1 -0
- package/dist/provider.d.ts +3 -3
- package/dist/provider.js +2 -2
- package/dist/{scroll-bar-C4qEUKlT.js → scroll-bar-BKRy5Me9.js} +1 -1
- package/dist/{scroll-bar-C4qEUKlT.js.map → scroll-bar-BKRy5Me9.js.map} +1 -1
- package/dist/separator-CgOz2m5i.d.ts +13 -0
- package/dist/separator-CgOz2m5i.d.ts.map +1 -0
- package/dist/{sheet-trigger-D7neoTF5.js → sheet-FVsgl5Wk.js} +32 -13
- package/dist/sheet-FVsgl5Wk.js.map +1 -0
- package/dist/{size-context-BjRwqlSg.js → size-context-CvLl3pMC.js} +3 -3
- package/dist/size-context-CvLl3pMC.js.map +1 -0
- package/dist/{size-context-DXfCAlWF.d.ts → size-context-DWvVJytl.d.ts} +2 -2
- package/dist/size-context-DWvVJytl.d.ts.map +1 -0
- package/dist/size-provider-18EvJgDT.js.map +1 -1
- package/dist/{size-provider-Bd2C6gKd.d.ts → size-provider-PHAZhU6k.d.ts} +2 -2
- package/dist/{size-provider-Bd2C6gKd.d.ts.map → size-provider-PHAZhU6k.d.ts.map} +1 -1
- package/dist/{size-system-wzOLSuax.d.ts → size-system-BAI1CnwU.d.ts} +1 -1
- package/dist/size-system-BAI1CnwU.d.ts.map +1 -0
- package/dist/size-system-BTsMqZRQ.js +99 -0
- package/dist/size-system-BTsMqZRQ.js.map +1 -0
- package/dist/size.d.ts +3 -3
- package/dist/size.js +2 -2
- package/dist/{slider-root-presentation-ChJHPMIV.js → slider-root-presentation-G0ByTcvd.js} +19 -19
- package/dist/slider-root-presentation-G0ByTcvd.js.map +1 -0
- package/dist/{slider-value-Db8SCu0c.d.ts → slider-style-tokens-DNzHvGii.d.ts} +55 -55
- package/dist/slider-style-tokens-DNzHvGii.d.ts.map +1 -0
- package/dist/textarea-rmoEkvdu.d.ts +37 -0
- package/dist/textarea-rmoEkvdu.d.ts.map +1 -0
- package/dist/textarea-vNt8edEA.js +39 -0
- package/dist/textarea-vNt8edEA.js.map +1 -0
- package/dist/toggle-D8kPPZH9.d.ts +53 -0
- package/dist/toggle-D8kPPZH9.d.ts.map +1 -0
- package/dist/{tooltip-trigger-qXw-_nbh.js → tooltip-BUo_HPnp.js} +38 -13
- package/dist/tooltip-BUo_HPnp.js.map +1 -0
- package/dist/{tooltip-viewport-csA6luqI.d.ts → tooltip-DatN3AoZ.d.ts} +62 -14
- package/dist/tooltip-DatN3AoZ.d.ts.map +1 -0
- package/dist/ui/accordion.d.ts +5 -5
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +53 -52
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/action-icon.d.ts +2 -0
- package/dist/ui/action-icon.js +74 -0
- package/dist/ui/action-icon.js.map +1 -0
- package/dist/ui/affix.d.ts +3 -2
- package/dist/ui/affix.d.ts.map +1 -1
- package/dist/ui/affix.js +8 -7
- package/dist/ui/affix.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts +4 -2
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +10 -9
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts +33 -33
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +86 -86
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/announcement.d.ts.map +1 -1
- package/dist/ui/announcement.js +5 -3
- package/dist/ui/announcement.js.map +1 -1
- package/dist/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/autocomplete.d.ts +74 -74
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +55 -53
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.d.ts +2 -39
- package/dist/ui/avatar.js +2 -24
- package/dist/ui/badge.d.ts +28 -28
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +2 -54
- package/dist/ui/breadcrumb.d.ts +65 -65
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +47 -45
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button-group.d.ts +35 -35
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +29 -28
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +2 -78
- package/dist/ui/button.js +33 -55
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +6 -6
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/carousel.d.ts +3 -3
- package/dist/ui/carousel.d.ts.map +1 -1
- package/dist/ui/carousel.js +41 -22
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/checkbox-group.d.ts.map +1 -1
- package/dist/ui/checkbox-group.js.map +1 -1
- package/dist/ui/checkbox.d.ts +21 -21
- package/dist/ui/checkbox.js +13 -13
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code.d.ts.map +1 -1
- package/dist/ui/code.js +5 -5
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/combobox.d.ts +107 -107
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +94 -93
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/command.d.ts +57 -58
- package/dist/ui/command.d.ts.map +1 -1
- package/dist/ui/command.js +54 -64
- package/dist/ui/command.js.map +1 -1
- package/dist/ui/container.d.ts.map +1 -1
- package/dist/ui/container.js.map +1 -1
- package/dist/ui/context-menu.d.ts +132 -132
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +100 -98
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/copy-button.d.ts +1 -3
- package/dist/ui/copy-button.d.ts.map +1 -1
- package/dist/ui/copy-button.js +40 -20
- package/dist/ui/copy-button.js.map +1 -1
- package/dist/ui/dialog.d.ts +2 -66
- package/dist/ui/dialog.js +2 -24
- package/dist/ui/drawer.d.ts +93 -93
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +68 -66
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +3 -144
- package/dist/ui/dropdown-menu.js +2 -39
- package/dist/ui/dropzone.d.ts +55 -55
- package/dist/ui/dropzone.d.ts.map +1 -1
- package/dist/ui/dropzone.js +77 -72
- package/dist/ui/dropzone.js.map +1 -1
- package/dist/ui/emoji-picker.d.ts +81 -81
- package/dist/ui/emoji-picker.d.ts.map +1 -1
- package/dist/ui/emoji-picker.js +92 -87
- package/dist/ui/emoji-picker.js.map +1 -1
- package/dist/ui/empty.d.ts +62 -60
- package/dist/ui/empty.d.ts.map +1 -1
- package/dist/ui/empty.js +47 -44
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.d.ts +12 -12
- package/dist/ui/field.d.ts.map +1 -1
- package/dist/ui/field.js +9 -7
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/fieldset.d.ts.map +1 -1
- package/dist/ui/fieldset.js.map +1 -1
- package/dist/ui/form.d.ts +8 -8
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/input-group.d.ts +35 -35
- package/dist/ui/input-group.d.ts.map +1 -1
- package/dist/ui/input-group.js +2 -28
- package/dist/ui/input-otp.d.ts +36 -36
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +29 -28
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.d.ts +2 -46
- package/dist/ui/input.js +2 -34
- package/dist/ui/item.d.ts +20 -20
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/item.js +22 -22
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/kbd.d.ts +1 -1
- package/dist/ui/kbd.d.ts.map +1 -1
- package/dist/ui/kbd.js +8 -8
- package/dist/ui/kbd.js.map +1 -1
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/marquee.d.ts.map +1 -1
- package/dist/ui/marquee.js +1 -1
- package/dist/ui/marquee.js.map +1 -1
- package/dist/ui/menubar.d.ts +133 -134
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +82 -81
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/meter.d.ts.map +1 -1
- package/dist/ui/meter.js.map +1 -1
- package/dist/ui/navigation-list.d.ts +227 -227
- package/dist/ui/navigation-list.d.ts.map +1 -1
- package/dist/ui/navigation-list.js +240 -235
- package/dist/ui/navigation-list.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts +82 -82
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +70 -67
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/number-field.d.ts +34 -34
- package/dist/ui/number-field.d.ts.map +1 -1
- package/dist/ui/number-field.js +24 -23
- package/dist/ui/number-field.js.map +1 -1
- package/dist/ui/pagination.d.ts +43 -43
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +57 -47
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/pill.d.ts +3 -4
- package/dist/ui/pill.d.ts.map +1 -1
- package/dist/ui/pill.js +37 -26
- package/dist/ui/pill.js.map +1 -1
- package/dist/ui/popover.d.ts +15 -13
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +17 -14
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/portal.d.ts.map +1 -1
- package/dist/ui/portal.js +52 -11
- package/dist/ui/portal.js.map +1 -1
- package/dist/ui/preview-card.js +5 -5
- package/dist/ui/preview-card.js.map +1 -1
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/qr-code.d.ts.map +1 -1
- package/dist/ui/qr-code.js +7 -7
- package/dist/ui/qr-code.js.map +1 -1
- package/dist/ui/radio-group.d.ts +23 -23
- package/dist/ui/radio-group.js +15 -15
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/range-slider.d.ts +1 -1
- package/dist/ui/range-slider.d.ts.map +1 -1
- package/dist/ui/range-slider.js +4 -7
- package/dist/ui/range-slider.js.map +1 -1
- package/dist/ui/rating.d.ts +35 -35
- package/dist/ui/rating.d.ts.map +1 -1
- package/dist/ui/rating.js +55 -46
- package/dist/ui/rating.js.map +1 -1
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/resizable.js +2 -2
- package/dist/ui/resizable.js.map +1 -1
- package/dist/ui/scroll-area.js +1 -1
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/select.d.ts +87 -87
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +85 -84
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.d.ts +2 -13
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +2 -24
- package/dist/ui/sidebar.d.ts +75 -76
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +88 -87
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/slider.d.ts +1 -1
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +3 -1
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/spacer.d.ts.map +1 -1
- package/dist/ui/spacer.js +2 -2
- package/dist/ui/spacer.js.map +1 -1
- package/dist/ui/spinner.d.ts +1 -1
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +2 -2
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/switch.d.ts +12 -12
- package/dist/ui/switch.js +7 -7
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.d.ts +62 -62
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +53 -47
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +25 -25
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +75 -68
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.d.ts +2 -37
- package/dist/ui/textarea.js +2 -35
- package/dist/ui/theme-icon.d.ts +30 -30
- package/dist/ui/theme-icon.d.ts.map +1 -1
- package/dist/ui/theme-icon.js +22 -22
- package/dist/ui/theme-icon.js.map +1 -1
- package/dist/ui/timeline.d.ts +6 -6
- package/dist/ui/timeline.d.ts.map +1 -1
- package/dist/ui/timeline.js +163 -163
- package/dist/ui/timeline.js.map +1 -1
- package/dist/ui/toggle-group.d.ts +33 -33
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +22 -16
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.d.ts +2 -53
- package/dist/ui/toggle.js +15 -15
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/toolbar.d.ts +56 -56
- package/dist/ui/toolbar.d.ts.map +1 -1
- package/dist/ui/toolbar.js +43 -40
- package/dist/ui/toolbar.js.map +1 -1
- package/dist/ui/tooltip.d.ts +3 -55
- package/dist/ui/tooltip.js +2 -28
- package/dist/ui/typography.d.ts +50 -36
- package/dist/ui/typography.d.ts.map +1 -1
- package/dist/ui/typography.js +28 -17
- package/dist/ui/typography.js.map +1 -1
- package/package.json +17 -15
- package/dist/avatar-image-BQ_NEKH4.js +0 -47
- package/dist/avatar-image-BQ_NEKH4.js.map +0 -1
- package/dist/avatar-image-Ce26D2fb.d.ts.map +0 -1
- package/dist/dialog-trigger-BUF3elAP.js.map +0 -1
- package/dist/dialog-viewport-Ce1huyAI.d.ts.map +0 -1
- package/dist/dropdown-menu-trigger-BpgtLUvf.d.ts.map +0 -1
- package/dist/dropdown-menu-trigger-COnFGfDa.js.map +0 -1
- package/dist/input-group-textarea-B-rP98r5.js.map +0 -1
- package/dist/sheet-trigger-D7neoTF5.js.map +0 -1
- package/dist/size-context-BjRwqlSg.js.map +0 -1
- package/dist/size-context-DXfCAlWF.d.ts.map +0 -1
- package/dist/size-system-DTXmtQXw.js +0 -47
- package/dist/size-system-DTXmtQXw.js.map +0 -1
- package/dist/size-system-wzOLSuax.d.ts.map +0 -1
- package/dist/slider-root-presentation-ChJHPMIV.js.map +0 -1
- package/dist/slider-value-Db8SCu0c.d.ts.map +0 -1
- package/dist/tooltip-trigger-qXw-_nbh.js.map +0 -1
- package/dist/tooltip-viewport-csA6luqI.d.ts.map +0 -1
- package/dist/ui/avatar.d.ts.map +0 -1
- package/dist/ui/avatar.js.map +0 -1
- package/dist/ui/badge.js.map +0 -1
- package/dist/ui/button.d.ts.map +0 -1
- package/dist/ui/dialog.d.ts.map +0 -1
- package/dist/ui/dialog.js.map +0 -1
- package/dist/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/ui/dropdown-menu.js.map +0 -1
- package/dist/ui/input-group.js.map +0 -1
- package/dist/ui/input.d.ts.map +0 -1
- package/dist/ui/input.js.map +0 -1
- package/dist/ui/separator.d.ts.map +0 -1
- package/dist/ui/sheet.js.map +0 -1
- package/dist/ui/textarea.d.ts.map +0 -1
- package/dist/ui/textarea.js.map +0 -1
- package/dist/ui/toggle.d.ts.map +0 -1
- package/dist/ui/tooltip.d.ts.map +0 -1
- package/dist/ui/tooltip.js.map +0 -1
- package/dist/use-badge-default-props-8d9wPL0k.js +0 -8
- package/dist/use-badge-default-props-8d9wPL0k.js.map +0 -1
- package/dist/use-input-default-props-B6VgKXGM.js +0 -8
- package/dist/use-input-default-props-B6VgKXGM.js.map +0 -1
- package/dist/use-textarea-default-props-7MlOxkDO.js +0 -8
- package/dist/use-textarea-default-props-7MlOxkDO.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { a as useComponentSize, i as useComponentDefaultProps } from "./size-provider-18EvJgDT.js";
|
|
2
|
+
import { t as mergeBaseUIClassName } from "./merge-base-ui-class-name-HKsgjcXj.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
import { Input } from "@base-ui/react/input";
|
|
6
|
+
|
|
7
|
+
//#region src/ui/input/use-input-default-props.ts
|
|
8
|
+
const useInputDefaultProps = (incomingProps) => useComponentDefaultProps("Input", {}, incomingProps);
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/ui/input/input.tsx
|
|
12
|
+
const inputVariants = tv({
|
|
13
|
+
base: "border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-danger/50 dark:aria-invalid:ring-danger/40 w-full min-w-0 border bg-transparent transition-colors outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-[3px]",
|
|
14
|
+
defaultVariants: { size: "md" },
|
|
15
|
+
variants: { size: {
|
|
16
|
+
lg: "h-10 rounded-md px-3 py-1.5 text-base file:h-8 file:text-sm md:text-sm",
|
|
17
|
+
md: "h-9 rounded-md px-2.5 py-1 text-base file:h-7 file:text-sm md:text-sm",
|
|
18
|
+
sm: "h-8 rounded-[min(var(--radius-md),10px)] px-2.5 py-1 text-sm file:h-6 file:text-xs",
|
|
19
|
+
xl: "h-11 rounded-md px-4 py-1.5 text-base file:h-8 file:text-base",
|
|
20
|
+
xs: "h-6 rounded-[min(var(--radius-md),8px)] px-2 py-0.5 text-xs file:h-5 file:text-xs"
|
|
21
|
+
} }
|
|
22
|
+
});
|
|
23
|
+
const Input$1 = (incomingProps) => {
|
|
24
|
+
const { className, htmlSize, size: providedSize, type, ...props } = useInputDefaultProps(incomingProps);
|
|
25
|
+
const size = useComponentSize(providedSize);
|
|
26
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
27
|
+
className: mergeBaseUIClassName(inputVariants({ size }), className),
|
|
28
|
+
"data-size": size,
|
|
29
|
+
"data-slot": "input",
|
|
30
|
+
size: htmlSize,
|
|
31
|
+
type,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Input$1 as t };
|
|
38
|
+
//# sourceMappingURL=input-cICL6sH_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-cICL6sH_.js","names":["Input","InputPrimitive"],"sources":["../src/ui/input/use-input-default-props.ts","../src/ui/input/input.tsx"],"sourcesContent":["import { useComponentDefaultProps } from \"../shared/size/size-provider\";\nimport type { InputProps } from \"./input\";\n\nexport const useInputDefaultProps = (incomingProps: InputProps): InputProps =>\n useComponentDefaultProps<InputProps>(\"Input\", {}, incomingProps);\n","\"use client\";\n\nimport { Input as InputPrimitive } from \"@base-ui/react/input\";\nimport type { ComponentProps } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport type { VariantProps } from \"tailwind-variants\";\n\nimport { mergeBaseUIClassName } from \"../../utils/merge-base-ui-class-name\";\nimport { useComponentSize } from \"../shared/size/size-provider\";\nimport type { UISize } from \"../shared/size/size-system\";\nimport { useInputDefaultProps } from \"./use-input-default-props\";\n\nconst inputVariants = tv({\n base: \"border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-danger/50 dark:aria-invalid:ring-danger/40 w-full min-w-0 border bg-transparent transition-colors outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-[3px]\",\n defaultVariants: {\n size: \"md\",\n },\n variants: {\n size: {\n lg: \"h-10 rounded-md px-3 py-1.5 text-base file:h-8 file:text-sm md:text-sm\",\n md: \"h-9 rounded-md px-2.5 py-1 text-base file:h-7 file:text-sm md:text-sm\",\n sm: \"h-8 rounded-[min(var(--radius-md),10px)] px-2.5 py-1 text-sm file:h-6 file:text-xs\",\n xl: \"h-11 rounded-md px-4 py-1.5 text-base file:h-8 file:text-base\",\n xs: \"h-6 rounded-[min(var(--radius-md),8px)] px-2 py-0.5 text-xs file:h-5 file:text-xs\",\n },\n },\n});\n\ntype InputVariantProps = Omit<VariantProps<typeof inputVariants>, \"size\"> & {\n size?: UISize;\n};\ntype NativeInputProps = ComponentProps<typeof InputPrimitive>;\ntype NativeInputSize = NativeInputProps[\"size\"];\n\nexport type InputSize = UISize;\n\nexport type InputProps = Omit<NativeInputProps, \"size\"> &\n InputVariantProps & {\n htmlSize?: NativeInputSize;\n };\n\nconst Input = (incomingProps: InputProps) => {\n const {\n className,\n htmlSize,\n size: providedSize,\n type,\n ...props\n } = useInputDefaultProps(incomingProps);\n const size = useComponentSize(providedSize);\n\n return (\n <InputPrimitive\n className={mergeBaseUIClassName<InputPrimitive.State>(\n inputVariants({ size }),\n className\n )}\n data-size={size}\n data-slot=\"input\"\n size={htmlSize}\n type={type}\n {...props}\n />\n );\n};\n\nexport { Input };\n"],"mappings":";;;;;;;AAGA,MAAa,wBAAwB,kBACnC,yBAAqC,SAAS,EAAE,EAAE,cAAc;;;;ACQlE,MAAM,gBAAgB,GAAG;CACvB,MAAM;CACN,iBAAiB,EACf,MAAM,MACP;CACD,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACF,CAAC;AAeF,MAAMA,WAAS,kBAA8B;CAC3C,MAAM,EACJ,WACA,UACA,MAAM,cACN,MACA,GAAG,UACD,qBAAqB,cAAc;CACvC,MAAM,OAAO,iBAAiB,aAAa;AAE3C,QACE,oBAACC,OAAD;EACE,WAAW,qBACT,cAAc,EAAE,MAAM,CAAC,EACvB,UACD;EACD,aAAW;EACX,aAAU;EACV,MAAM;EACA;EACN,GAAI;EACJ"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { a as useComponentSize } from "./size-provider-18EvJgDT.js";
|
|
1
2
|
import { Button } from "./ui/button.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ActionIcon } from "./ui/action-icon.js";
|
|
4
|
+
import { t as Input } from "./input-cICL6sH_.js";
|
|
5
|
+
import { t as Textarea } from "./textarea-vNt8edEA.js";
|
|
6
|
+
import { createContext, useContext, useMemo } from "react";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
import { cn, tv } from "tailwind-variants";
|
|
7
9
|
|
|
@@ -11,34 +13,31 @@ const InputGroupContext = createContext({ size: "md" });
|
|
|
11
13
|
//#endregion
|
|
12
14
|
//#region src/ui/input-group/input-group-addon.tsx
|
|
13
15
|
const inputGroupAddonVariants = tv({
|
|
14
|
-
base: "flex h-auto cursor-text items-center justify-center font-medium
|
|
16
|
+
base: "text-muted-foreground flex h-auto cursor-text items-center justify-center font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--kb-radius)-5px)]",
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
align: "inline-start",
|
|
19
|
+
size: "md"
|
|
20
|
+
},
|
|
15
21
|
variants: {
|
|
16
22
|
align: {
|
|
17
|
-
"
|
|
18
|
-
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem]",
|
|
23
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
|
|
19
24
|
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
20
|
-
"
|
|
25
|
+
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem]",
|
|
26
|
+
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.25rem] has-[>kbd]:ml-[-0.15rem]"
|
|
21
27
|
},
|
|
22
28
|
size: {
|
|
23
|
-
xs: "gap-1 py-0.5 text-xs [&>svg:not([class*='size-'])]:size-3",
|
|
24
|
-
sm: "gap-1.5 py-1 text-sm [&>svg:not([class*='size-'])]:size-3.5",
|
|
25
|
-
md: "gap-2 py-1.5 text-sm [&>svg:not([class*='size-'])]:size-4",
|
|
26
29
|
lg: "gap-2 py-2 text-sm [&>svg:not([class*='size-'])]:size-4",
|
|
27
|
-
|
|
30
|
+
md: "gap-2 py-1.5 text-sm [&>svg:not([class*='size-'])]:size-4",
|
|
31
|
+
sm: "gap-1.5 py-1 text-sm [&>svg:not([class*='size-'])]:size-3.5",
|
|
32
|
+
xl: "gap-2.5 py-2 text-base [&>svg:not([class*='size-'])]:size-5",
|
|
33
|
+
xs: "gap-1 py-0.5 text-xs [&>svg:not([class*='size-'])]:size-3"
|
|
28
34
|
}
|
|
29
|
-
},
|
|
30
|
-
defaultVariants: {
|
|
31
|
-
align: "inline-start",
|
|
32
|
-
size: "md"
|
|
33
35
|
}
|
|
34
36
|
});
|
|
35
37
|
const focusInput = (e) => {
|
|
36
38
|
if (e.target.closest("button")) return;
|
|
37
39
|
(e.currentTarget.parentElement?.querySelector("input, textarea"))?.focus();
|
|
38
40
|
};
|
|
39
|
-
const handleKeyDown = (e) => {
|
|
40
|
-
if (e.key === "Enter" || e.key === " ") (e.currentTarget.parentElement?.querySelector("input, textarea"))?.focus();
|
|
41
|
-
};
|
|
42
41
|
const InputGroupAddon = ({ className, align = "inline-start", size, ...props }) => {
|
|
43
42
|
const { size: contextSize } = useContext(InputGroupContext);
|
|
44
43
|
const resolvedSize = size ?? contextSize ?? "md";
|
|
@@ -50,9 +49,7 @@ const InputGroupAddon = ({ className, align = "inline-start", size, ...props })
|
|
|
50
49
|
"data-align": align,
|
|
51
50
|
"data-size": resolvedSize,
|
|
52
51
|
"data-slot": "input-group-addon",
|
|
53
|
-
|
|
54
|
-
onKeyDown: handleKeyDown,
|
|
55
|
-
role: "group",
|
|
52
|
+
onPointerDown: focusInput,
|
|
56
53
|
...props
|
|
57
54
|
});
|
|
58
55
|
};
|
|
@@ -61,29 +58,38 @@ const InputGroupAddon = ({ className, align = "inline-start", size, ...props })
|
|
|
61
58
|
//#region src/ui/input-group/input-group-button.tsx
|
|
62
59
|
const inputGroupButtonVariants = tv({
|
|
63
60
|
base: "flex items-center gap-2 text-sm shadow-none",
|
|
61
|
+
defaultVariants: { size: "xs" },
|
|
64
62
|
variants: { size: {
|
|
65
|
-
|
|
66
|
-
sm: "",
|
|
67
|
-
md: "",
|
|
63
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
68
64
|
"icon-xs": "size-6 rounded-[calc(var(--kb-radius)-5px)] p-0 has-[>svg]:p-0",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
md: "",
|
|
66
|
+
sm: "",
|
|
67
|
+
xs: "h-6 gap-1 rounded-[calc(var(--kb-radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5"
|
|
68
|
+
} }
|
|
72
69
|
});
|
|
73
70
|
const mapInputGroupSizeToButtonSize = (size) => {
|
|
74
71
|
if (size === "xl") return "sm";
|
|
75
72
|
return "xs";
|
|
76
73
|
};
|
|
74
|
+
const isInputGroupActionIconSize = (size) => size === "icon-sm" || size === "icon-xs";
|
|
75
|
+
const mapInputGroupActionIconSizeToActionIconSize = (size) => size === "icon-sm" ? "sm" : "xs";
|
|
77
76
|
const InputGroupButton = ({ className, type = "button", variant = "ghost", size, ...props }) => {
|
|
78
77
|
const { size: contextSize } = useContext(InputGroupContext);
|
|
79
78
|
const resolvedSize = size ?? mapInputGroupSizeToButtonSize(contextSize);
|
|
80
|
-
|
|
81
|
-
className: cn(inputGroupButtonVariants({ size: resolvedSize }), className),
|
|
79
|
+
const sharedProps = {
|
|
80
|
+
className: cn(inputGroupButtonVariants({ size: resolvedSize }), "cursor-clickable", className),
|
|
82
81
|
"data-size": resolvedSize,
|
|
83
|
-
size: resolvedSize,
|
|
84
82
|
type,
|
|
85
83
|
variant,
|
|
86
84
|
...props
|
|
85
|
+
};
|
|
86
|
+
if (isInputGroupActionIconSize(resolvedSize)) return /* @__PURE__ */ jsx(ActionIcon, {
|
|
87
|
+
size: mapInputGroupActionIconSizeToActionIconSize(resolvedSize),
|
|
88
|
+
...sharedProps
|
|
89
|
+
});
|
|
90
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
91
|
+
...sharedProps,
|
|
92
|
+
size: resolvedSize
|
|
87
93
|
});
|
|
88
94
|
};
|
|
89
95
|
|
|
@@ -103,7 +109,7 @@ const InputGroupInput = ({ className, size, ...props }) => {
|
|
|
103
109
|
//#endregion
|
|
104
110
|
//#region src/ui/input-group/input-group-text.tsx
|
|
105
111
|
const InputGroupText = ({ className, ...props }) => /* @__PURE__ */ jsx("span", {
|
|
106
|
-
className: cn("flex items-center gap-2 text-inherit
|
|
112
|
+
className: cn("text-muted-foreground flex items-center gap-2 text-inherit [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-[1em]", className),
|
|
107
113
|
...props
|
|
108
114
|
});
|
|
109
115
|
|
|
@@ -116,5 +122,28 @@ const InputGroupTextarea = ({ className, ...props }) => /* @__PURE__ */ jsx(Text
|
|
|
116
122
|
});
|
|
117
123
|
|
|
118
124
|
//#endregion
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
//#region src/ui/input-group/input-group.tsx
|
|
126
|
+
const InputGroup = ({ className, children, size: providedSize, ...props }) => {
|
|
127
|
+
const size = useComponentSize(providedSize);
|
|
128
|
+
const contextValue = useMemo(() => ({ size }), [size]);
|
|
129
|
+
return /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: cn("group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-danger has-[[data-slot][aria-invalid=true]]:ring-danger/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-danger/40 relative flex w-full min-w-0 items-center border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto data-[size=lg]:h-10 data-[size=lg]:rounded-md data-[size=md]:h-9 data-[size=md]:rounded-md data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=xl]:h-11 data-[size=xl]:rounded-md data-[size=xs]:h-6 data-[size=xs]:rounded-[min(var(--radius-md),8px)] has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
131
|
+
"data-size": size,
|
|
132
|
+
"data-slot": "input-group",
|
|
133
|
+
role: "group",
|
|
134
|
+
...props,
|
|
135
|
+
children: /* @__PURE__ */ jsx(InputGroupContext.Provider, {
|
|
136
|
+
value: contextValue,
|
|
137
|
+
children
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
InputGroup.Addon = InputGroupAddon;
|
|
142
|
+
InputGroup.Button = InputGroupButton;
|
|
143
|
+
InputGroup.Input = InputGroupInput;
|
|
144
|
+
InputGroup.Text = InputGroupText;
|
|
145
|
+
InputGroup.Textarea = InputGroupTextarea;
|
|
146
|
+
|
|
147
|
+
//#endregion
|
|
148
|
+
export { InputGroupButton as a, InputGroupInput as i, InputGroupTextarea as n, InputGroupAddon as o, InputGroupText as r, InputGroup as t };
|
|
149
|
+
//# sourceMappingURL=input-group-7kPror1q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group-7kPror1q.js","names":[],"sources":["../src/ui/input-group/input-group-context.tsx","../src/ui/input-group/input-group-addon.tsx","../src/ui/input-group/input-group-button.tsx","../src/ui/input-group/input-group-input.tsx","../src/ui/input-group/input-group-text.tsx","../src/ui/input-group/input-group-textarea.tsx","../src/ui/input-group/input-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\n\nimport type { InputSize } from \"../input/input\";\n\nexport interface InputGroupContextValue {\n size?: InputSize;\n}\n\nconst InputGroupContext = createContext<InputGroupContextValue>({\n size: \"md\",\n});\n\nexport { InputGroupContext };\n","\"use client\";\n\nimport type { ComponentProps, PointerEvent } from \"react\";\nimport { useContext } from \"react\";\nimport { cn, tv } from \"tailwind-variants\";\nimport type { VariantProps } from \"tailwind-variants\";\n\nimport { InputGroupContext } from \"./input-group-context\";\nexport type InputGroupAddonProps = ComponentProps<\"div\"> &\n VariantProps<typeof inputGroupAddonVariants>;\n\nconst inputGroupAddonVariants = tv({\n base: \"text-muted-foreground flex h-auto cursor-text items-center justify-center font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--kb-radius)-5px)]\",\n defaultVariants: {\n align: \"inline-start\",\n size: \"md\",\n },\n variants: {\n align: {\n \"block-end\":\n \"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2\",\n \"block-start\":\n \"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2\",\n \"inline-end\":\n \"order-last pr-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem]\",\n \"inline-start\":\n \"order-first pl-2 has-[>button]:ml-[-0.25rem] has-[>kbd]:ml-[-0.15rem]\",\n },\n size: {\n lg: \"gap-2 py-2 text-sm [&>svg:not([class*='size-'])]:size-4\",\n md: \"gap-2 py-1.5 text-sm [&>svg:not([class*='size-'])]:size-4\",\n sm: \"gap-1.5 py-1 text-sm [&>svg:not([class*='size-'])]:size-3.5\",\n xl: \"gap-2.5 py-2 text-base [&>svg:not([class*='size-'])]:size-5\",\n xs: \"gap-1 py-0.5 text-xs [&>svg:not([class*='size-'])]:size-3\",\n },\n },\n});\n\nconst focusInput = (e: PointerEvent<HTMLDivElement>) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n const control =\n e.currentTarget.parentElement?.querySelector<HTMLElement>(\n \"input, textarea\"\n );\n control?.focus();\n};\n\nconst InputGroupAddon = ({\n className,\n align = \"inline-start\",\n size,\n ...props\n}: InputGroupAddonProps) => {\n const { size: contextSize } = useContext(InputGroupContext);\n const resolvedSize = size ?? contextSize ?? \"md\";\n\n return (\n <div\n className={cn(\n inputGroupAddonVariants({ align, size: resolvedSize }),\n className\n )}\n data-align={align}\n data-size={resolvedSize}\n data-slot=\"input-group-addon\"\n onPointerDown={focusInput}\n {...props}\n />\n );\n};\n\nexport { InputGroupAddon, inputGroupAddonVariants };\n","\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { useContext } from \"react\";\nimport { cn, tv } from \"tailwind-variants\";\nimport type { VariantProps } from \"tailwind-variants\";\n\nimport { ActionIcon } from \"../action-icon/action-icon\";\nimport { Button } from \"../button/button\";\nimport type { InputSize } from \"../input/input\";\nimport { InputGroupContext } from \"./input-group-context\";\nexport type InputGroupButtonProps = Omit<\n ComponentProps<typeof Button>,\n \"size\" | \"type\"\n> &\n VariantProps<typeof inputGroupButtonVariants> & {\n type?: \"button\" | \"submit\" | \"reset\";\n };\n\nconst inputGroupButtonVariants = tv({\n base: \"flex items-center gap-2 text-sm shadow-none\",\n defaultVariants: {\n size: \"xs\",\n },\n variants: {\n size: {\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--kb-radius)-5px)] p-0 has-[>svg]:p-0\",\n md: \"\",\n sm: \"\",\n xs: \"h-6 gap-1 rounded-[calc(var(--kb-radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5\",\n },\n },\n});\n\nconst mapInputGroupSizeToButtonSize = (size?: InputSize) => {\n if (size === \"xl\") {\n return \"sm\";\n }\n\n return \"xs\";\n};\n\nconst isInputGroupActionIconSize = (\n size: InputGroupButtonProps[\"size\"]\n): size is \"icon-sm\" | \"icon-xs\" => size === \"icon-sm\" || size === \"icon-xs\";\n\nconst mapInputGroupActionIconSizeToActionIconSize = (\n size: \"icon-sm\" | \"icon-xs\"\n) => (size === \"icon-sm\" ? \"sm\" : \"xs\");\n\nconst InputGroupButton = ({\n className,\n type = \"button\",\n variant = \"ghost\",\n size,\n ...props\n}: InputGroupButtonProps) => {\n const { size: contextSize } = useContext(InputGroupContext);\n const resolvedSize = size ?? mapInputGroupSizeToButtonSize(contextSize);\n const sharedProps = {\n className: cn(\n inputGroupButtonVariants({ size: resolvedSize }),\n \"cursor-clickable\",\n className\n ),\n \"data-size\": resolvedSize,\n type,\n variant,\n ...props,\n };\n\n if (isInputGroupActionIconSize(resolvedSize)) {\n return (\n <ActionIcon\n size={mapInputGroupActionIconSizeToActionIconSize(resolvedSize)}\n {...sharedProps}\n />\n );\n }\n\n return <Button {...sharedProps} size={resolvedSize} />;\n};\n\nexport { InputGroupButton, inputGroupButtonVariants };\n","\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { useContext } from \"react\";\nimport { cn } from \"tailwind-variants\";\n\nimport { Input } from \"../input/input\";\nimport { InputGroupContext } from \"./input-group-context\";\nexport type InputGroupInputProps = ComponentProps<typeof Input>;\n\nconst InputGroupInput = ({\n className,\n size,\n ...props\n}: InputGroupInputProps) => {\n const { size: contextSize } = useContext(InputGroupContext);\n const resolvedSize = size ?? contextSize ?? \"md\";\n\n return (\n <Input\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent\",\n className\n )}\n data-slot=\"input-group-control\"\n size={resolvedSize}\n {...props}\n />\n );\n};\n\nexport { InputGroupInput };\n","\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"tailwind-variants\";\nexport type InputGroupTextProps = ComponentProps<\"span\">;\n\nconst InputGroupText = ({ className, ...props }: InputGroupTextProps) => (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-inherit [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-[1em]\",\n className\n )}\n {...props}\n />\n);\n\nexport { InputGroupText };\n","\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"tailwind-variants\";\n\nimport { Textarea } from \"../textarea/textarea\";\nexport type InputGroupTextareaProps = ComponentProps<typeof Textarea>;\n\nconst InputGroupTextarea = ({\n className,\n ...props\n}: InputGroupTextareaProps) => (\n <Textarea\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent\",\n className\n )}\n data-slot=\"input-group-control\"\n {...props}\n />\n);\n\nexport { InputGroupTextarea };\n","\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\nimport { cn } from \"tailwind-variants\";\n\nimport type { InputSize } from \"../input/input\";\nimport { useComponentSize } from \"../shared/size/size-provider\";\nimport { InputGroupAddon } from \"./input-group-addon\";\nimport { InputGroupButton } from \"./input-group-button\";\nimport { InputGroupContext } from \"./input-group-context\";\nimport { InputGroupInput } from \"./input-group-input\";\nimport { InputGroupText } from \"./input-group-text\";\nimport { InputGroupTextarea } from \"./input-group-textarea\";\nexport type InputGroupProps = ComponentProps<\"div\"> & {\n size?: InputSize;\n};\n\nconst InputGroup = ({\n className,\n children,\n size: providedSize,\n ...props\n}: InputGroupProps) => {\n const size = useComponentSize(providedSize);\n const contextValue = useMemo(() => ({ size }), [size]);\n\n return (\n <div\n className={cn(\n \"group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-danger has-[[data-slot][aria-invalid=true]]:ring-danger/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-danger/40 relative flex w-full min-w-0 items-center border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto data-[size=lg]:h-10 data-[size=lg]:rounded-md data-[size=md]:h-9 data-[size=md]:rounded-md data-[size=sm]:h-8 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=xl]:h-11 data-[size=xl]:rounded-md data-[size=xs]:h-6 data-[size=xs]:rounded-[min(var(--radius-md),8px)] has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5\",\n className\n )}\n data-size={size}\n data-slot=\"input-group\"\n role=\"group\"\n {...props}\n >\n <InputGroupContext.Provider value={contextValue}>\n {children}\n </InputGroupContext.Provider>\n </div>\n );\n};\n\nInputGroup.Addon = InputGroupAddon;\nInputGroup.Button = InputGroupButton;\nInputGroup.Input = InputGroupInput;\nInputGroup.Text = InputGroupText;\nInputGroup.Textarea = InputGroupTextarea;\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n InputGroupText,\n InputGroupTextarea,\n};\n\nexport type { InputGroupAddonProps } from \"./input-group-addon\";\nexport type { InputGroupButtonProps } from \"./input-group-button\";\nexport type { InputGroupInputProps } from \"./input-group-input\";\nexport type { InputGroupTextProps } from \"./input-group-text\";\nexport type { InputGroupTextareaProps } from \"./input-group-textarea\";\n"],"mappings":";;;;;;;;;;AAUA,MAAM,oBAAoB,cAAsC,EAC9D,MAAM,MACP,CAAC;;;;ACDF,MAAM,0BAA0B,GAAG;CACjC,MAAM;CACN,iBAAiB;EACf,OAAO;EACP,MAAM;EACP;CACD,UAAU;EACR,OAAO;GACL,aACE;GACF,eACE;GACF,cACE;GACF,gBACE;GACH;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACF,CAAC;AAEF,MAAM,cAAc,MAAoC;AACtD,KAAK,EAAE,OAAuB,QAAQ,SAAS,CAC7C;AAMF,EAHE,EAAE,cAAc,eAAe,cAC7B,kBACD,GACM,OAAO;;AAGlB,MAAM,mBAAmB,EACvB,WACA,QAAQ,gBACR,MACA,GAAG,YACuB;CAC1B,MAAM,EAAE,MAAM,gBAAgB,WAAW,kBAAkB;CAC3D,MAAM,eAAe,QAAQ,eAAe;AAE5C,QACE,oBAAC,OAAD;EACE,WAAW,GACT,wBAAwB;GAAE;GAAO,MAAM;GAAc,CAAC,EACtD,UACD;EACD,cAAY;EACZ,aAAW;EACX,aAAU;EACV,eAAe;EACf,GAAI;EACJ;;;;;AClDN,MAAM,2BAA2B,GAAG;CAClC,MAAM;CACN,iBAAiB,EACf,MAAM,MACP;CACD,UAAU,EACR,MAAM;EACJ,WAAW;EACX,WACE;EACF,IAAI;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACF,CAAC;AAEF,MAAM,iCAAiC,SAAqB;AAC1D,KAAI,SAAS,KACX,QAAO;AAGT,QAAO;;AAGT,MAAM,8BACJ,SACkC,SAAS,aAAa,SAAS;AAEnE,MAAM,+CACJ,SACI,SAAS,YAAY,OAAO;AAElC,MAAM,oBAAoB,EACxB,WACA,OAAO,UACP,UAAU,SACV,MACA,GAAG,YACwB;CAC3B,MAAM,EAAE,MAAM,gBAAgB,WAAW,kBAAkB;CAC3D,MAAM,eAAe,QAAQ,8BAA8B,YAAY;CACvE,MAAM,cAAc;EAClB,WAAW,GACT,yBAAyB,EAAE,MAAM,cAAc,CAAC,EAChD,oBACA,UACD;EACD,aAAa;EACb;EACA;EACA,GAAG;EACJ;AAED,KAAI,2BAA2B,aAAa,CAC1C,QACE,oBAAC,YAAD;EACE,MAAM,4CAA4C,aAAa;EAC/D,GAAI;EACJ;AAIN,QAAO,oBAAC,QAAD;EAAQ,GAAI;EAAa,MAAM;EAAgB;;;;;ACxExD,MAAM,mBAAmB,EACvB,WACA,MACA,GAAG,YACuB;CAC1B,MAAM,EAAE,MAAM,gBAAgB,WAAW,kBAAkB;CAC3D,MAAM,eAAe,QAAQ,eAAe;AAE5C,QACE,oBAAC,OAAD;EACE,WAAW,GACT,oLACA,UACD;EACD,aAAU;EACV,MAAM;EACN,GAAI;EACJ;;;;;ACrBN,MAAM,kBAAkB,EAAE,WAAW,GAAG,YACtC,oBAAC,QAAD;CACE,WAAW,GACT,mIACA,UACD;CACD,GAAI;CACJ;;;;ACLJ,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,oBAAC,UAAD;CACE,WAAW,GACT,qMACA,UACD;CACD,aAAU;CACV,GAAI;CACJ;;;;ACDJ,MAAM,cAAc,EAClB,WACA,UACA,MAAM,cACN,GAAG,YACkB;CACrB,MAAM,OAAO,iBAAiB,aAAa;CAC3C,MAAM,eAAe,eAAe,EAAE,MAAM,GAAG,CAAC,KAAK,CAAC;AAEtD,QACE,oBAAC,OAAD;EACE,WAAW,GACT,y1CACA,UACD;EACD,aAAW;EACX,aAAU;EACV,MAAK;EACL,GAAI;YAEJ,oBAAC,kBAAkB,UAAnB;GAA4B,OAAO;GAChC;GAC0B;EACzB;;AAIV,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,WAAW"}
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as UI_SIZE_ORDER, t as UISize } from "./size-system-
|
|
2
|
-
import { t as createSizeContext } from "./size-context-
|
|
3
|
-
import { _ as DEFAULT_UI_SIZE, a as KuzenboEnv, c as filterUndefinedProps, d as useGlobalUISize, f as useKuzenboComponentDefaults, g as useOptionalKuzenboContext, h as useKuzenboReducedMotion, i as KuzenboComponentsConfig, l as useComponentDefaultProps, m as useKuzenboEnv, n as KuzenboComponentConfig, o as KuzenboProvider, p as useKuzenboContext, r as KuzenboComponentDefaultProps, s as KuzenboProviderProps, t as KUZENBO_PROVIDER_MISSING_ERROR, u as useComponentSize, v as resolveSize } from "./size-provider-
|
|
1
|
+
import { n as UI_SIZE_ORDER, t as UISize } from "./size-system-BAI1CnwU.js";
|
|
2
|
+
import { t as createSizeContext } from "./size-context-DWvVJytl.js";
|
|
3
|
+
import { _ as DEFAULT_UI_SIZE, a as KuzenboEnv, c as filterUndefinedProps, d as useGlobalUISize, f as useKuzenboComponentDefaults, g as useOptionalKuzenboContext, h as useKuzenboReducedMotion, i as KuzenboComponentsConfig, l as useComponentDefaultProps, m as useKuzenboEnv, n as KuzenboComponentConfig, o as KuzenboProvider, p as useKuzenboContext, r as KuzenboComponentDefaultProps, s as KuzenboProviderProps, t as KUZENBO_PROVIDER_MISSING_ERROR, u as useComponentSize, v as resolveSize } from "./size-provider-PHAZhU6k.js";
|
|
4
4
|
export { DEFAULT_UI_SIZE, KUZENBO_PROVIDER_MISSING_ERROR, type KuzenboComponentConfig, type KuzenboComponentDefaultProps, type KuzenboComponentsConfig, type KuzenboEnv, KuzenboProvider, type KuzenboProviderProps, type UISize, UI_SIZE_ORDER, createSizeContext, filterUndefinedProps, resolveSize, useComponentDefaultProps, useComponentSize, useGlobalUISize, useKuzenboComponentDefaults, useKuzenboContext, useKuzenboEnv, useKuzenboReducedMotion, useOptionalKuzenboContext };
|
package/dist/provider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { a as useComponentSize, c as useKuzenboContext, d as useOptionalKuzenboContext, f as DEFAULT_UI_SIZE, i as useComponentDefaultProps, l as useKuzenboEnv, n as KuzenboProvider, o as useGlobalUISize, p as resolveSize, r as filterUndefinedProps, s as useKuzenboComponentDefaults, t as KUZENBO_PROVIDER_MISSING_ERROR, u as useKuzenboReducedMotion } from "./size-provider-18EvJgDT.js";
|
|
4
|
-
import { t as createSizeContext } from "./size-context-
|
|
5
|
-
import {
|
|
4
|
+
import { t as createSizeContext } from "./size-context-CvLl3pMC.js";
|
|
5
|
+
import { t as UI_SIZE_ORDER } from "./size-system-BTsMqZRQ.js";
|
|
6
6
|
|
|
7
7
|
export { DEFAULT_UI_SIZE, KUZENBO_PROVIDER_MISSING_ERROR, KuzenboProvider, UI_SIZE_ORDER, createSizeContext, filterUndefinedProps, resolveSize, useComponentDefaultProps, useComponentSize, useGlobalUISize, useKuzenboComponentDefaults, useKuzenboContext, useKuzenboEnv, useKuzenboReducedMotion, useOptionalKuzenboContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-bar-
|
|
1
|
+
{"version":3,"file":"scroll-bar-BKRy5Me9.js","names":["ScrollAreaPrimitive","ScrollAreaPrimitive"],"sources":["../src/ui/scroll-area/scroll-thumb.tsx","../src/ui/scroll-area/scroll-bar.tsx"],"sourcesContent":["import { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\";\n\nimport { mergeBaseUIClassName } from \"../../utils/merge-base-ui-class-name\";\nexport type ScrollAreaThumbProps = ScrollAreaPrimitive.Thumb.Props;\n\nconst ScrollAreaThumb = ({ className, ...props }: ScrollAreaThumbProps) => (\n <ScrollAreaPrimitive.Thumb\n className={mergeBaseUIClassName<ScrollAreaPrimitive.Thumb.State>(\n \"relative flex-1 rounded-full bg-border\",\n className\n )}\n data-slot=\"scroll-area-thumb\"\n {...props}\n />\n);\n\nexport { ScrollAreaThumb };\n","import { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\";\nimport { cn } from \"tailwind-variants\";\n\nimport { mergeBaseUIClassName } from \"../../utils/merge-base-ui-class-name\";\nimport { ScrollAreaThumb } from \"./scroll-thumb\";\nexport type ScrollBarProps = ScrollAreaPrimitive.Scrollbar.Props;\n\nconst ScrollBar = ({\n className,\n orientation = \"vertical\",\n children,\n ...props\n}: ScrollBarProps) => (\n <ScrollAreaPrimitive.Scrollbar\n className={mergeBaseUIClassName<ScrollAreaPrimitive.Scrollbar.State>(\n cn(\n \"flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent\"\n ),\n className\n )}\n data-orientation={orientation}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n {...props}\n >\n {children ?? <ScrollAreaThumb />}\n </ScrollAreaPrimitive.Scrollbar>\n);\n\nexport { ScrollBar };\n"],"mappings":";;;;;;AAKA,MAAM,mBAAmB,EAAE,WAAW,GAAG,YACvC,oBAACA,WAAoB,OAArB;CACE,WAAW,qBACT,0CACA,UACD;CACD,aAAU;CACV,GAAI;CACJ;;;;ACNJ,MAAM,aAAa,EACjB,WACA,cAAc,YACd,UACA,GAAG,YAEH,oBAACC,WAAoB,WAArB;CACE,WAAW,qBACT,GACE,qQACD,EACD,UACD;CACD,oBAAkB;CAClB,aAAU;CACG;CACb,GAAI;WAEH,YAAY,oBAAC,iBAAD,EAAmB;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { Separator } from "@base-ui/react/separator";
|
|
3
|
+
|
|
4
|
+
//#region src/ui/separator/separator.d.ts
|
|
5
|
+
type SeparatorProps = Separator.Props;
|
|
6
|
+
declare const Separator$1: ({
|
|
7
|
+
className,
|
|
8
|
+
orientation,
|
|
9
|
+
...props
|
|
10
|
+
}: SeparatorProps) => react_jsx_runtime0.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { SeparatorProps as n, Separator$1 as t };
|
|
13
|
+
//# sourceMappingURL=separator-CgOz2m5i.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator-CgOz2m5i.d.ts","names":[],"sources":["../src/ui/separator/separator.tsx"],"mappings":";;;;KAMY,cAAA,GAAiB,SAAA,CAAmB,KAAA;AAAA,cAE1C,WAAA;EAAa,SAAA;EAAA,WAAA;EAAA,GAAA;AAAA,GAIhB,cAAA,KAAc,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionIcon } from "./ui/action-icon.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "tailwind-variants";
|
|
4
4
|
import { Cancel01Icon } from "@hugeicons/core-free-icons";
|
|
@@ -7,7 +7,7 @@ import { Dialog } from "@base-ui/react/dialog";
|
|
|
7
7
|
|
|
8
8
|
//#region src/ui/sheet/sheet-backdrop.tsx
|
|
9
9
|
const SheetBackdrop = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
10
|
-
className: cn("
|
|
10
|
+
className: cn("z-overlay data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 fixed inset-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs", className),
|
|
11
11
|
"data-slot": "sheet-backdrop",
|
|
12
12
|
...props
|
|
13
13
|
});
|
|
@@ -15,7 +15,7 @@ const SheetBackdrop = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Ba
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/ui/sheet/sheet-close.tsx
|
|
17
17
|
const SheetClose = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Close, {
|
|
18
|
-
className: cn("cursor-
|
|
18
|
+
className: cn("cursor-clickable", className),
|
|
19
19
|
"data-slot": "sheet-close",
|
|
20
20
|
...props
|
|
21
21
|
});
|
|
@@ -23,7 +23,7 @@ const SheetClose = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Close
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/ui/sheet/sheet-popup.tsx
|
|
25
25
|
const SheetPopup = ({ className, side = "right", ...props }) => /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
26
|
-
className: cn("
|
|
26
|
+
className: cn("z-overlay bg-background data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 fixed flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
|
|
27
27
|
"data-side": side,
|
|
28
28
|
"data-slot": "sheet-popup",
|
|
29
29
|
...props
|
|
@@ -39,7 +39,7 @@ const SheetPortal = ({ ...props }) => /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/ui/sheet/sheet-viewport.tsx
|
|
41
41
|
const SheetViewport = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
42
|
-
className: cn("fixed inset-0
|
|
42
|
+
className: cn("z-overlay fixed inset-0", className),
|
|
43
43
|
"data-slot": "sheet-viewport",
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
@@ -53,9 +53,9 @@ const SheetContent = ({ className, children, side = "right", showCloseButton = t
|
|
|
53
53
|
...props,
|
|
54
54
|
children: [children, showCloseButton && /* @__PURE__ */ jsxs(SheetClose, {
|
|
55
55
|
"data-slot": "sheet-close",
|
|
56
|
-
render: /* @__PURE__ */ jsx(
|
|
57
|
-
className: "absolute top-4 right-4",
|
|
58
|
-
size: "
|
|
56
|
+
render: /* @__PURE__ */ jsx(ActionIcon, {
|
|
57
|
+
className: "cursor-clickable absolute top-4 right-4",
|
|
58
|
+
size: "sm",
|
|
59
59
|
variant: "ghost"
|
|
60
60
|
}),
|
|
61
61
|
children: [/* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
@@ -71,7 +71,7 @@ const SheetContent = ({ className, children, side = "right", showCloseButton = t
|
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/ui/sheet/sheet-description.tsx
|
|
73
73
|
const SheetDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Description, {
|
|
74
|
-
className: cn("text-
|
|
74
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
75
75
|
"data-slot": "sheet-description",
|
|
76
76
|
...props
|
|
77
77
|
});
|
|
@@ -103,7 +103,7 @@ const SheetOverlay = ({ className, ...props }) => /* @__PURE__ */ jsx(SheetBackd
|
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/ui/sheet/sheet-title.tsx
|
|
105
105
|
const SheetTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Title, {
|
|
106
|
-
className: cn("text-base font-medium
|
|
106
|
+
className: cn("text-foreground text-base font-medium", className),
|
|
107
107
|
"data-slot": "sheet-title",
|
|
108
108
|
...props
|
|
109
109
|
});
|
|
@@ -111,11 +111,30 @@ const SheetTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Title
|
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/ui/sheet/sheet-trigger.tsx
|
|
113
113
|
const SheetTrigger = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
114
|
-
className: cn("cursor-
|
|
114
|
+
className: cn("cursor-clickable", className),
|
|
115
115
|
"data-slot": "sheet-trigger",
|
|
116
116
|
...props
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
//#endregion
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
//#region src/ui/sheet/sheet.tsx
|
|
121
|
+
const Sheet = ({ ...props }) => /* @__PURE__ */ jsx(Dialog.Root, {
|
|
122
|
+
"data-slot": "sheet",
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
Sheet.Close = SheetClose;
|
|
126
|
+
Sheet.Content = SheetContent;
|
|
127
|
+
Sheet.Backdrop = SheetBackdrop;
|
|
128
|
+
Sheet.Description = SheetDescription;
|
|
129
|
+
Sheet.Footer = SheetFooter;
|
|
130
|
+
Sheet.Header = SheetHeader;
|
|
131
|
+
Sheet.Overlay = SheetOverlay;
|
|
132
|
+
Sheet.Portal = SheetPortal;
|
|
133
|
+
Sheet.Popup = SheetPopup;
|
|
134
|
+
Sheet.Title = SheetTitle;
|
|
135
|
+
Sheet.Trigger = SheetTrigger;
|
|
136
|
+
Sheet.Viewport = SheetViewport;
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
export { SheetHeader as a, SheetContent as c, SheetPopup as d, SheetClose as f, SheetOverlay as i, SheetViewport as l, SheetTrigger as n, SheetFooter as o, SheetBackdrop as p, SheetTitle as r, SheetDescription as s, Sheet as t, SheetPortal as u };
|
|
140
|
+
//# sourceMappingURL=sheet-FVsgl5Wk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-FVsgl5Wk.js","names":["SheetPrimitive","SheetPrimitive","SheetPrimitive","SheetPrimitive","SheetPrimitive","SheetPrimitive","SheetPrimitive","SheetPrimitive","SheetPrimitive"],"sources":["../src/ui/sheet/sheet-backdrop.tsx","../src/ui/sheet/sheet-close.tsx","../src/ui/sheet/sheet-popup.tsx","../src/ui/sheet/sheet-portal.tsx","../src/ui/sheet/sheet-viewport.tsx","../src/ui/sheet/sheet-content.tsx","../src/ui/sheet/sheet-description.tsx","../src/ui/sheet/sheet-footer.tsx","../src/ui/sheet/sheet-header.tsx","../src/ui/sheet/sheet-overlay.tsx","../src/ui/sheet/sheet-title.tsx","../src/ui/sheet/sheet-trigger.tsx","../src/ui/sheet/sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\n\nexport type SheetBackdropProps = SheetPrimitive.Backdrop.Props;\n\nconst SheetBackdrop = ({ className, ...props }: SheetBackdropProps) => (\n <SheetPrimitive.Backdrop\n className={cn(\n \"z-overlay data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 fixed inset-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n data-slot=\"sheet-backdrop\"\n {...props}\n />\n);\n\nexport { SheetBackdrop };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\nexport type SheetCloseProps = SheetPrimitive.Close.Props;\n\nconst SheetClose = ({ className, ...props }: SheetCloseProps) => (\n <SheetPrimitive.Close\n className={cn(\"cursor-clickable\", className)}\n data-slot=\"sheet-close\"\n {...props}\n />\n);\n\nexport { SheetClose };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\n\nexport type SheetSide = \"top\" | \"right\" | \"bottom\" | \"left\";\nexport type SheetPopupProps = SheetPrimitive.Popup.Props & {\n side?: SheetSide;\n};\n\nconst SheetPopup = ({\n className,\n side = \"right\",\n ...props\n}: SheetPopupProps) => (\n <SheetPrimitive.Popup\n className={cn(\n \"z-overlay bg-background data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 fixed flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n data-side={side}\n data-slot=\"sheet-popup\"\n {...props}\n />\n);\n\nexport { SheetPopup };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nexport type SheetPortalProps = SheetPrimitive.Portal.Props;\n\nconst SheetPortal = ({ ...props }: SheetPortalProps) => (\n <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n);\n\nexport { SheetPortal };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\n\nexport type SheetViewportProps = SheetPrimitive.Viewport.Props;\n\nconst SheetViewport = ({ className, ...props }: SheetViewportProps) => (\n <SheetPrimitive.Viewport\n className={cn(\"z-overlay fixed inset-0\", className)}\n data-slot=\"sheet-viewport\"\n {...props}\n />\n);\n\nexport { SheetViewport };\n","\"use client\";\n\nimport { Cancel01Icon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\n\nimport { ActionIcon } from \"../action-icon/action-icon\";\nimport { SheetBackdrop } from \"./sheet-backdrop\";\nimport { SheetClose } from \"./sheet-close\";\nimport { SheetPopup } from \"./sheet-popup\";\nimport type { SheetPopupProps, SheetSide } from \"./sheet-popup\";\nimport { SheetPortal } from \"./sheet-portal\";\nimport { SheetViewport } from \"./sheet-viewport\";\nexport type SheetContentProps = SheetPopupProps & {\n side?: SheetSide;\n showCloseButton?: boolean;\n};\n\nconst SheetContent = ({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetContentProps) => (\n <SheetPortal>\n <SheetBackdrop />\n <SheetViewport>\n <SheetPopup\n className={className}\n data-slot=\"sheet-content\"\n side={side}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetClose\n data-slot=\"sheet-close\"\n render={\n <ActionIcon\n className=\"cursor-clickable absolute top-4 right-4\"\n size=\"sm\"\n variant=\"ghost\"\n />\n }\n >\n <HugeiconsIcon icon={Cancel01Icon} strokeWidth={2} />\n <span className=\"sr-only\">Close</span>\n </SheetClose>\n )}\n </SheetPopup>\n </SheetViewport>\n </SheetPortal>\n);\n\nexport { SheetContent };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\nexport type SheetDescriptionProps = SheetPrimitive.Description.Props;\n\nconst SheetDescription = ({ className, ...props }: SheetDescriptionProps) => (\n <SheetPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n data-slot=\"sheet-description\"\n {...props}\n />\n);\n\nexport { SheetDescription };\n","import type { ComponentProps } from \"react\";\nimport { cn } from \"tailwind-variants\";\nexport type SheetFooterProps = ComponentProps<\"div\">;\n\nconst SheetFooter = ({ className, ...props }: SheetFooterProps) => (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n data-slot=\"sheet-footer\"\n {...props}\n />\n);\n\nexport { SheetFooter };\n","import type { ComponentProps } from \"react\";\nimport { cn } from \"tailwind-variants\";\nexport type SheetHeaderProps = ComponentProps<\"div\">;\n\nconst SheetHeader = ({ className, ...props }: SheetHeaderProps) => (\n <div\n className={cn(\"flex flex-col gap-0.5 p-4\", className)}\n data-slot=\"sheet-header\"\n {...props}\n />\n);\n\nexport { SheetHeader };\n","\"use client\";\n\nimport { SheetBackdrop } from \"./sheet-backdrop\";\nimport type { SheetBackdropProps } from \"./sheet-backdrop\";\nexport type SheetOverlayProps = SheetBackdropProps;\n\nconst SheetOverlay = ({ className, ...props }: SheetOverlayProps) => (\n <SheetBackdrop className={className} data-slot=\"sheet-overlay\" {...props} />\n);\n\nexport { SheetOverlay };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\nexport type SheetTitleProps = SheetPrimitive.Title.Props;\n\nconst SheetTitle = ({ className, ...props }: SheetTitleProps) => (\n <SheetPrimitive.Title\n className={cn(\"text-foreground text-base font-medium\", className)}\n data-slot=\"sheet-title\"\n {...props}\n />\n);\n\nexport { SheetTitle };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { cn } from \"tailwind-variants\";\nexport type SheetTriggerProps = SheetPrimitive.Trigger.Props;\n\nconst SheetTrigger = ({ className, ...props }: SheetTriggerProps) => (\n <SheetPrimitive.Trigger\n className={cn(\"cursor-clickable\", className)}\n data-slot=\"sheet-trigger\"\n {...props}\n />\n);\n\nexport { SheetTrigger };\n","\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\n\nimport { SheetBackdrop } from \"./sheet-backdrop\";\nimport { SheetClose } from \"./sheet-close\";\nimport { SheetContent } from \"./sheet-content\";\nimport { SheetDescription } from \"./sheet-description\";\nimport { SheetFooter } from \"./sheet-footer\";\nimport { SheetHeader } from \"./sheet-header\";\nimport { SheetOverlay } from \"./sheet-overlay\";\nimport { SheetPopup } from \"./sheet-popup\";\nimport { SheetPortal } from \"./sheet-portal\";\nimport { SheetTitle } from \"./sheet-title\";\nimport { SheetTrigger } from \"./sheet-trigger\";\nimport { SheetViewport } from \"./sheet-viewport\";\nexport type SheetProps = SheetPrimitive.Root.Props;\n\nconst Sheet = ({ ...props }: SheetProps) => (\n <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n);\n\nSheet.Close = SheetClose;\nSheet.Content = SheetContent;\nSheet.Backdrop = SheetBackdrop;\nSheet.Description = SheetDescription;\nSheet.Footer = SheetFooter;\nSheet.Header = SheetHeader;\nSheet.Overlay = SheetOverlay;\nSheet.Portal = SheetPortal;\nSheet.Popup = SheetPopup;\nSheet.Title = SheetTitle;\nSheet.Trigger = SheetTrigger;\nSheet.Viewport = SheetViewport;\n\nexport {\n Sheet,\n SheetBackdrop,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetPopup,\n SheetTitle,\n SheetTrigger,\n SheetViewport,\n};\n\nexport type { SheetBackdropProps } from \"./sheet-backdrop\";\nexport type { SheetCloseProps } from \"./sheet-close\";\nexport type { SheetContentProps } from \"./sheet-content\";\nexport type { SheetDescriptionProps } from \"./sheet-description\";\nexport type { SheetFooterProps } from \"./sheet-footer\";\nexport type { SheetHeaderProps } from \"./sheet-header\";\nexport type { SheetOverlayProps } from \"./sheet-overlay\";\nexport type { SheetPopupProps } from \"./sheet-popup\";\nexport type { SheetPortalProps } from \"./sheet-portal\";\nexport type { SheetTitleProps } from \"./sheet-title\";\nexport type { SheetTriggerProps } from \"./sheet-trigger\";\nexport type { SheetViewportProps } from \"./sheet-viewport\";\n"],"mappings":";;;;;;;;AAOA,MAAM,iBAAiB,EAAE,WAAW,GAAG,YACrC,oBAACA,OAAe,UAAhB;CACE,WAAW,GACT,gPACA,UACD;CACD,aAAU;CACV,GAAI;CACJ;;;;ACTJ,MAAM,cAAc,EAAE,WAAW,GAAG,YAClC,oBAACC,OAAe,OAAhB;CACE,WAAW,GAAG,oBAAoB,UAAU;CAC5C,aAAU;CACV,GAAI;CACJ;;;;ACDJ,MAAM,cAAc,EAClB,WACA,OAAO,SACP,GAAG,YAEH,oBAACC,OAAe,OAAhB;CACE,WAAW,GACT,+mCACA,UACD;CACD,aAAW;CACX,aAAU;CACV,GAAI;CACJ;;;;AClBJ,MAAM,eAAe,EAAE,GAAG,YACxB,oBAACC,OAAe,QAAhB;CAAuB,aAAU;CAAe,GAAI;CAAS;;;;ACC/D,MAAM,iBAAiB,EAAE,WAAW,GAAG,YACrC,oBAACC,OAAe,UAAhB;CACE,WAAW,GAAG,2BAA2B,UAAU;CACnD,aAAU;CACV,GAAI;CACJ;;;;ACKJ,MAAM,gBAAgB,EACpB,WACA,UACA,OAAO,SACP,kBAAkB,MAClB,GAAG,YAEH,qBAAC,aAAD,aACE,oBAAC,eAAD,EAAiB,GACjB,oBAAC,eAAD,YACE,qBAAC,YAAD;CACa;CACX,aAAU;CACJ;CACN,GAAI;WAJN,CAMG,UACA,mBACC,qBAAC,YAAD;EACE,aAAU;EACV,QACE,oBAAC,YAAD;GACE,WAAU;GACV,MAAK;GACL,SAAQ;GACR;YAPN,CAUE,oBAAC,eAAD;GAAe,MAAM;GAAc,aAAa;GAAK,GACrD,oBAAC,QAAD;GAAM,WAAU;aAAU;GAAY,EAC3B;IAEJ;IACC,EACJ;;;;AC7ChB,MAAM,oBAAoB,EAAE,WAAW,GAAG,YACxC,oBAACC,OAAe,aAAhB;CACE,WAAW,GAAG,iCAAiC,UAAU;CACzD,aAAU;CACV,GAAI;CACJ;;;;ACPJ,MAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CACE,WAAW,GAAG,mCAAmC,UAAU;CAC3D,aAAU;CACV,GAAI;CACJ;;;;ACLJ,MAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CACE,WAAW,GAAG,6BAA6B,UAAU;CACrD,aAAU;CACV,GAAI;CACJ;;;;ACHJ,MAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,eAAD;CAA0B;CAAW,aAAU;CAAgB,GAAI;CAAS;;;;ACD9E,MAAM,cAAc,EAAE,WAAW,GAAG,YAClC,oBAACC,OAAe,OAAhB;CACE,WAAW,GAAG,yCAAyC,UAAU;CACjE,aAAU;CACV,GAAI;CACJ;;;;ACLJ,MAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAACC,OAAe,SAAhB;CACE,WAAW,GAAG,oBAAoB,UAAU;CAC5C,aAAU;CACV,GAAI;CACJ;;;;ACOJ,MAAM,SAAS,EAAE,GAAG,YAClB,oBAACC,OAAe,MAAhB;CAAqB,aAAU;CAAQ,GAAI;CAAS;AAGtD,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,WAAW;AACjB,MAAM,cAAc;AACpB,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,WAAW"}
|
|
@@ -4,8 +4,8 @@ import { createContext, useContext } from "react";
|
|
|
4
4
|
//#region src/ui/shared/size/size-context.ts
|
|
5
5
|
const createSizeContext = (defaultSize = DEFAULT_UI_SIZE) => {
|
|
6
6
|
const SizeContext = createContext({
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
hasFallbackDefault: true,
|
|
8
|
+
size: defaultSize
|
|
9
9
|
});
|
|
10
10
|
const useResolvedSize = (...candidates) => {
|
|
11
11
|
const [explicitCandidate, ...contextAfterCandidates] = candidates;
|
|
@@ -22,4 +22,4 @@ const createSizeContext = (defaultSize = DEFAULT_UI_SIZE) => {
|
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { createSizeContext as t };
|
|
25
|
-
//# sourceMappingURL=size-context-
|
|
25
|
+
//# sourceMappingURL=size-context-CvLl3pMC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size-context-CvLl3pMC.js","names":[],"sources":["../src/ui/shared/size/size-context.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\nimport { DEFAULT_UI_SIZE, resolveSize } from \"./resolve-size\";\nimport { useGlobalUISize } from \"./size-provider\";\nimport type { UISize } from \"./size-system\";\n\nexport interface SizeContextValue {\n size?: UISize;\n}\n\nexport const createSizeContext = (defaultSize: UISize = DEFAULT_UI_SIZE) => {\n const SizeContext = createContext<\n SizeContextValue & {\n hasFallbackDefault?: true;\n }\n >({\n hasFallbackDefault: true,\n size: defaultSize,\n });\n\n const useResolvedSize = (...candidates: (UISize | undefined | null)[]) => {\n const [explicitCandidate, ...contextAfterCandidates] = candidates;\n const { hasFallbackDefault, size: contextSize } = useContext(SizeContext);\n const localSize = hasFallbackDefault ? undefined : contextSize;\n const globalSize = useGlobalUISize();\n\n return resolveSize(\n explicitCandidate,\n localSize,\n ...contextAfterCandidates,\n globalSize,\n defaultSize\n );\n };\n\n return { SizeContext, useResolvedSize };\n};\n"],"mappings":";;;;AAYA,MAAa,qBAAqB,cAAsB,oBAAoB;CAC1E,MAAM,cAAc,cAIlB;EACA,oBAAoB;EACpB,MAAM;EACP,CAAC;CAEF,MAAM,mBAAmB,GAAG,eAA8C;EACxE,MAAM,CAAC,mBAAmB,GAAG,0BAA0B;EACvD,MAAM,EAAE,oBAAoB,MAAM,gBAAgB,WAAW,YAAY;EACzE,MAAM,YAAY,qBAAqB,SAAY;EACnD,MAAM,aAAa,iBAAiB;AAEpC,SAAO,YACL,mBACA,WACA,GAAG,wBACH,YACA,YACD;;AAGH,QAAO;EAAE;EAAa;EAAiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as UISize } from "./size-system-
|
|
1
|
+
import { t as UISize } from "./size-system-BAI1CnwU.js";
|
|
2
2
|
import * as react from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/shared/size/size-context.d.ts
|
|
@@ -13,4 +13,4 @@ declare const createSizeContext: (defaultSize?: UISize) => {
|
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
15
15
|
export { createSizeContext as t };
|
|
16
|
-
//# sourceMappingURL=size-context-
|
|
16
|
+
//# sourceMappingURL=size-context-DWvVJytl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size-context-DWvVJytl.d.ts","names":[],"sources":["../src/ui/shared/size/size-context.ts"],"mappings":";;;;UAQiB,gBAAA;EACf,IAAA,GAAO,MAAA;AAAA;AAAA,cAGI,iBAAA,GAAqB,WAAA,GAAa,MAAA;;;;oCAUJ,MAAA,2BAA4B,MAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size-provider-18EvJgDT.js","names":[],"sources":["../src/ui/shared/size/resolve-size.ts","../src/ui/shared/provider/create-strict-context.ts","../src/ui/shared/size/size-provider.tsx"],"sourcesContent":["import type { UISize } from \"./size-system\";\n\nconst DEFAULT_UI_SIZE: UISize = \"md\";\n\nexport const resolveSize = (\n ...candidates: (UISize | undefined | null)[]\n): UISize => {\n for (const candidate of candidates) {\n if (candidate !== undefined && candidate !== null) {\n return candidate;\n }\n }\n\n return DEFAULT_UI_SIZE;\n};\n\nexport { DEFAULT_UI_SIZE };\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\nexport const createStrictContext = <T>(errorMessage: string) => {\n const StrictContext = createContext<T | null>(null);\n\n const useStrictContext = (): T => {\n const context = useContext(StrictContext);\n\n if (!context) {\n throw new Error(errorMessage);\n }\n\n return context;\n };\n\n const useOptionalContext = (): T | null => useContext(StrictContext);\n\n return {\n StrictContext,\n useOptionalContext,\n useStrictContext,\n };\n};\n","\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\
|
|
1
|
+
{"version":3,"file":"size-provider-18EvJgDT.js","names":[],"sources":["../src/ui/shared/size/resolve-size.ts","../src/ui/shared/provider/create-strict-context.ts","../src/ui/shared/size/size-provider.tsx"],"sourcesContent":["import type { UISize } from \"./size-system\";\n\nconst DEFAULT_UI_SIZE: UISize = \"md\";\n\nexport const resolveSize = (\n ...candidates: (UISize | undefined | null)[]\n): UISize => {\n for (const candidate of candidates) {\n if (candidate !== undefined && candidate !== null) {\n return candidate;\n }\n }\n\n return DEFAULT_UI_SIZE;\n};\n\nexport { DEFAULT_UI_SIZE };\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\nexport const createStrictContext = <T>(errorMessage: string) => {\n const StrictContext = createContext<T | null>(null);\n\n const useStrictContext = (): T => {\n const context = useContext(StrictContext);\n\n if (!context) {\n throw new Error(errorMessage);\n }\n\n return context;\n };\n\n const useOptionalContext = (): T | null => useContext(StrictContext);\n\n return {\n StrictContext,\n useOptionalContext,\n useStrictContext,\n };\n};\n","\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { createStrictContext } from \"../provider/create-strict-context\";\nimport { DEFAULT_UI_SIZE, resolveSize } from \"./resolve-size\";\nimport type { UISize } from \"./size-system\";\n\nexport type KuzenboEnv = \"default\" | \"test\";\nexport type KuzenboComponentDefaultProps = Record<string, unknown>;\n\nexport interface KuzenboComponentConfig {\n defaultProps?: KuzenboComponentDefaultProps;\n}\n\nexport type KuzenboComponentsConfig = Record<\n string,\n KuzenboComponentConfig | undefined\n>;\n\nexport interface KuzenboContextValue {\n components: KuzenboComponentsConfig;\n defaultRadius?: number | string;\n defaultSize?: UISize;\n env: KuzenboEnv;\n reducedMotion: boolean;\n}\n\nexport interface KuzenboProviderProps {\n children: ReactNode;\n components?: KuzenboComponentsConfig;\n defaultRadius?: number | string;\n defaultSize?: UISize;\n env?: KuzenboEnv;\n inherit?: boolean;\n reducedMotion?: boolean;\n}\n\nexport const KUZENBO_PROVIDER_MISSING_ERROR =\n \"[@kuzenbo/core] KuzenboProvider was not found in tree. Wrap app root with <KuzenboProvider>.\";\n\nconst {\n StrictContext: KuzenboContext,\n useOptionalContext: useOptionalKuzenboContextInternal,\n} = createStrictContext<KuzenboContextValue>(KUZENBO_PROVIDER_MISSING_ERROR);\n\nconst KUZENBO_TEST_CONTEXT_FALLBACK: KuzenboContextValue = {\n components: {},\n defaultRadius: undefined,\n defaultSize: undefined,\n env: \"test\",\n reducedMotion: false,\n};\n\nconst isMissingProviderAllowed = (): boolean =>\n (\n globalThis as {\n __KUZENBO_ALLOW_MISSING_PROVIDER__?: boolean;\n }\n ).__KUZENBO_ALLOW_MISSING_PROVIDER__ === true;\n\nconst mergeComponentConfigs = (\n parent: KuzenboComponentsConfig | undefined,\n own: KuzenboComponentsConfig | undefined\n): KuzenboComponentsConfig => {\n const merged: KuzenboComponentsConfig = { ...parent };\n\n if (!own) {\n return merged;\n }\n\n for (const [componentName, componentConfig] of Object.entries(own)) {\n const parentConfig = merged[componentName];\n\n if (!componentConfig) {\n merged[componentName] = parentConfig;\n continue;\n }\n\n merged[componentName] = {\n ...parentConfig,\n ...componentConfig,\n defaultProps: {\n ...parentConfig?.defaultProps,\n ...componentConfig.defaultProps,\n },\n };\n }\n\n return merged;\n};\n\nconst toRadiusVariableValue = (value: number | string): string =>\n typeof value === \"number\" ? `${value}px` : value;\n\nexport const filterUndefinedProps = <T extends object>(\n input: Partial<T> | undefined\n): Partial<T> => {\n if (!input) {\n return {};\n }\n\n const filtered: Partial<T> = {};\n\n for (const [key, value] of Object.entries(input)) {\n if (value !== undefined) {\n filtered[key as keyof T] = value as T[keyof T];\n }\n }\n\n return filtered;\n};\n\nexport const KuzenboProvider = ({\n children,\n components,\n defaultRadius,\n defaultSize,\n env,\n inherit = true,\n reducedMotion,\n}: KuzenboProviderProps) => {\n const parentContext = useOptionalKuzenboContextInternal();\n const inheritedContext = inherit ? parentContext : null;\n\n const contextValue = useMemo<KuzenboContextValue>(\n () => ({\n components: mergeComponentConfigs(\n inheritedContext?.components,\n components\n ),\n defaultRadius: defaultRadius ?? inheritedContext?.defaultRadius,\n defaultSize: defaultSize ?? inheritedContext?.defaultSize,\n env: env ?? inheritedContext?.env ?? \"default\",\n reducedMotion: reducedMotion ?? inheritedContext?.reducedMotion ?? false,\n }),\n [\n components,\n defaultRadius,\n defaultSize,\n env,\n inheritedContext,\n reducedMotion,\n ]\n );\n\n const providerStyle = useMemo(() => {\n const style: CSSProperties = {\n display: \"contents\",\n };\n\n if (contextValue.defaultRadius !== undefined) {\n (\n style as CSSProperties & {\n \"--kb-radius\": string;\n }\n )[\"--kb-radius\"] = toRadiusVariableValue(contextValue.defaultRadius);\n }\n\n return style;\n }, [contextValue.defaultRadius]);\n\n return (\n <KuzenboContext.Provider value={contextValue}>\n <div\n data-kb-env={contextValue.env}\n data-kb-motion={contextValue.reducedMotion ? \"reduce\" : \"allow\"}\n data-slot=\"kuzenbo-provider\"\n style={providerStyle}\n >\n {children}\n </div>\n </KuzenboContext.Provider>\n );\n};\n\nexport const useKuzenboContext = (): KuzenboContextValue => {\n const context = useOptionalKuzenboContextInternal();\n\n if (context) {\n return context;\n }\n\n if (isMissingProviderAllowed()) {\n return KUZENBO_TEST_CONTEXT_FALLBACK;\n }\n\n throw new Error(KUZENBO_PROVIDER_MISSING_ERROR);\n};\n\nexport const useOptionalKuzenboContext = (): KuzenboContextValue | null =>\n useOptionalKuzenboContextInternal();\n\nexport const useKuzenboEnv = (): KuzenboEnv => useKuzenboContext().env;\n\nexport const useKuzenboReducedMotion = (): boolean =>\n useKuzenboContext().reducedMotion;\n\nexport const useKuzenboComponentDefaults = <T extends object>(\n componentName: string\n): Partial<T> => {\n const context = useKuzenboContext();\n\n return (context.components[componentName]?.defaultProps ?? {}) as Partial<T>;\n};\n\nexport const useComponentDefaultProps = <T extends object>(\n componentName: string,\n defaultProps: Partial<T>,\n props: T\n): T => {\n const componentDefaults = useKuzenboComponentDefaults<T>(componentName);\n\n return {\n ...filterUndefinedProps(defaultProps),\n ...filterUndefinedProps(componentDefaults),\n ...filterUndefinedProps(props),\n } as T;\n};\n\nexport const useGlobalUISize = (): UISize | undefined =>\n useKuzenboContext().defaultSize;\n\nexport const useComponentSize = (\n ...candidates: (UISize | undefined | null)[]\n): UISize => {\n const globalSize = useGlobalUISize();\n\n return resolveSize(...candidates, globalSize, DEFAULT_UI_SIZE);\n};\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as UISize } from "./size-system-
|
|
1
|
+
import { t as UISize } from "./size-system-BAI1CnwU.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -50,4 +50,4 @@ declare const useGlobalUISize: () => UISize | undefined;
|
|
|
50
50
|
declare const useComponentSize: (...candidates: (UISize | undefined | null)[]) => UISize;
|
|
51
51
|
//#endregion
|
|
52
52
|
export { DEFAULT_UI_SIZE as _, KuzenboEnv as a, filterUndefinedProps as c, useGlobalUISize as d, useKuzenboComponentDefaults as f, useOptionalKuzenboContext as g, useKuzenboReducedMotion as h, KuzenboComponentsConfig as i, useComponentDefaultProps as l, useKuzenboEnv as m, KuzenboComponentConfig as n, KuzenboProvider as o, useKuzenboContext as p, KuzenboComponentDefaultProps as r, KuzenboProviderProps as s, KUZENBO_PROVIDER_MISSING_ERROR as t, useComponentSize as u, resolveSize as v };
|
|
53
|
-
//# sourceMappingURL=size-provider-
|
|
53
|
+
//# sourceMappingURL=size-provider-PHAZhU6k.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size-provider-
|
|
1
|
+
{"version":3,"file":"size-provider-PHAZhU6k.d.ts","names":[],"sources":["../src/ui/shared/size/resolve-size.ts","../src/ui/shared/size/size-provider.tsx"],"mappings":";;;;;cAEM,eAAA,EAAiB,MAAA;AAAA,cAEV,WAAA,MACR,UAAA,GAAa,MAAA,2BACf,MAAA;;;KCGS,UAAA;AAAA,KACA,4BAAA,GAA+B,MAAA;AAAA,UAE1B,sBAAA;EACf,YAAA,GAAe,4BAAA;AAAA;AAAA,KAGL,uBAAA,GAA0B,MAAA,SAEpC,sBAAA;AAAA,UAGe,mBAAA;EACf,UAAA,EAAY,uBAAA;EACZ,aAAA;EACA,WAAA,GAAc,MAAA;EACd,GAAA,EAAK,UAAA;EACL,aAAA;AAAA;AAAA,UAGe,oBAAA;EACf,QAAA,EAAU,SAAA;EACV,UAAA,GAAa,uBAAA;EACb,aAAA;EACA,WAAA,GAAc,MAAA;EACd,GAAA,GAAM,UAAA;EACN,OAAA;EACA,aAAA;AAAA;AAAA,cAGW,8BAAA;AAAA,cAyDA,oBAAA,qBACX,KAAA,EAAO,OAAA,CAAQ,CAAA,kBACd,OAAA,CAAQ,CAAA;AAAA,cAgBE,eAAA;EAAmB,QAAA;EAAA,UAAA;EAAA,aAAA;EAAA,WAAA;EAAA,GAAA;EAAA,OAAA;EAAA;AAAA,GAQ7B,oBAAA,KAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAuDV,iBAAA,QAAwB,mBAAA;AAAA,cAcxB,yBAAA,QAAgC,mBAAA;AAAA,cAGhC,aAAA,QAAoB,UAAA;AAAA,cAEpB,uBAAA;AAAA,cAGA,2BAAA,qBACX,aAAA,aACC,OAAA,CAAQ,CAAA;AAAA,cAME,wBAAA,qBACX,aAAA,UACA,YAAA,EAAc,OAAA,CAAQ,CAAA,GACtB,KAAA,EAAO,CAAA,KACN,CAAA;AAAA,cAUU,eAAA,QAAsB,MAAA;AAAA,cAGtB,gBAAA,MACR,UAAA,GAAa,MAAA,2BACf,MAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size-system-BAI1CnwU.d.ts","names":[],"sources":["../src/ui/shared/size/size-system.ts"],"mappings":";KAEY,MAAA;AAAA,cAEC,aAAA,WAAwB,MAAA"}
|