@kushagradhawan/kookie-ui 0.1.16 → 0.1.18
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/components.css +3730 -1072
- package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-button.js +1 -1
- package/dist/cjs/components/_internal/base-button.js.map +3 -3
- package/dist/cjs/components/_internal/base-button.props.d.ts +9 -0
- package/dist/cjs/components/_internal/base-button.props.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-button.props.js +1 -1
- package/dist/cjs/components/_internal/base-button.props.js.map +3 -3
- package/dist/cjs/components/_internal/base-menu.props.d.ts +5 -0
- package/dist/cjs/components/_internal/base-menu.props.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-menu.props.js +1 -1
- package/dist/cjs/components/_internal/base-menu.props.js.map +3 -3
- package/dist/cjs/components/_internal/base-tab-list.props.d.ts +5 -0
- package/dist/cjs/components/_internal/base-tab-list.props.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-tab-list.props.js +1 -1
- package/dist/cjs/components/_internal/base-tab-list.props.js.map +3 -3
- package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.js.map +3 -3
- package/dist/cjs/components/avatar.d.ts.map +1 -1
- package/dist/cjs/components/avatar.js +1 -1
- package/dist/cjs/components/avatar.js.map +3 -3
- package/dist/cjs/components/avatar.props.d.ts +6 -1
- package/dist/cjs/components/avatar.props.d.ts.map +1 -1
- package/dist/cjs/components/avatar.props.js +1 -1
- package/dist/cjs/components/avatar.props.js.map +3 -3
- package/dist/cjs/components/badge.d.ts.map +1 -1
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/badge.js.map +3 -3
- package/dist/cjs/components/badge.props.d.ts +6 -1
- package/dist/cjs/components/badge.props.d.ts.map +1 -1
- package/dist/cjs/components/badge.props.js +1 -1
- package/dist/cjs/components/badge.props.js.map +2 -2
- package/dist/cjs/components/callout.d.ts.map +1 -1
- package/dist/cjs/components/callout.js +1 -1
- package/dist/cjs/components/callout.js.map +3 -3
- package/dist/cjs/components/callout.props.d.ts +5 -0
- package/dist/cjs/components/callout.props.d.ts.map +1 -1
- package/dist/cjs/components/callout.props.js +1 -1
- package/dist/cjs/components/callout.props.js.map +3 -3
- package/dist/cjs/components/card.d.ts.map +1 -1
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +3 -3
- package/dist/cjs/components/card.props.d.ts +11 -2
- package/dist/cjs/components/card.props.d.ts.map +1 -1
- package/dist/cjs/components/card.props.js +1 -1
- package/dist/cjs/components/card.props.js.map +3 -3
- package/dist/cjs/components/context-menu.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +3 -3
- package/dist/cjs/components/dialog.d.ts.map +1 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/dialog.props.d.ts +5 -0
- package/dist/cjs/components/dialog.props.d.ts.map +1 -1
- package/dist/cjs/components/dialog.props.js +1 -1
- package/dist/cjs/components/dialog.props.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +3 -3
- package/dist/cjs/components/image.d.ts +6 -1
- package/dist/cjs/components/image.d.ts.map +1 -1
- package/dist/cjs/components/image.js +1 -1
- package/dist/cjs/components/image.js.map +3 -3
- package/dist/cjs/components/popover.d.ts.map +1 -1
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +3 -3
- package/dist/cjs/components/popover.props.d.ts +5 -0
- package/dist/cjs/components/popover.props.d.ts.map +1 -1
- package/dist/cjs/components/popover.props.js +1 -1
- package/dist/cjs/components/popover.props.js.map +3 -3
- package/dist/cjs/components/select.d.ts.map +1 -1
- package/dist/cjs/components/select.js +1 -1
- package/dist/cjs/components/select.js.map +3 -3
- package/dist/cjs/components/select.props.d.ts +6 -1
- package/dist/cjs/components/select.props.d.ts.map +1 -1
- package/dist/cjs/components/select.props.js +1 -1
- package/dist/cjs/components/select.props.js.map +2 -2
- package/dist/cjs/components/sidebar.d.ts +13 -2
- package/dist/cjs/components/sidebar.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +3 -3
- package/dist/cjs/components/sidebar.props.d.ts +5 -0
- package/dist/cjs/components/sidebar.props.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.props.js +1 -1
- package/dist/cjs/components/sidebar.props.js.map +2 -2
- package/dist/cjs/components/tabs.d.ts.map +1 -1
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +3 -3
- package/dist/cjs/components/text-area.d.ts.map +1 -1
- package/dist/cjs/components/text-area.js +1 -1
- package/dist/cjs/components/text-area.js.map +3 -3
- package/dist/cjs/components/text-area.props.d.ts +6 -1
- package/dist/cjs/components/text-area.props.d.ts.map +1 -1
- package/dist/cjs/components/text-area.props.js +1 -1
- package/dist/cjs/components/text-area.props.js.map +3 -3
- package/dist/cjs/components/text-field.d.ts.map +1 -1
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text-field.js.map +3 -3
- package/dist/cjs/components/text-field.props.d.ts +6 -1
- package/dist/cjs/components/text-field.props.d.ts.map +1 -1
- package/dist/cjs/components/text-field.props.js +1 -1
- package/dist/cjs/components/text-field.props.js.map +3 -3
- package/dist/cjs/components/theme.d.ts.map +1 -1
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +2 -2
- package/dist/cjs/helpers/map-prop-values.js +1 -1
- package/dist/cjs/helpers/map-prop-values.js.map +2 -2
- package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/base-button.js.map +3 -3
- package/dist/esm/components/_internal/base-button.props.d.ts +9 -0
- package/dist/esm/components/_internal/base-button.props.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-button.props.js +1 -1
- package/dist/esm/components/_internal/base-button.props.js.map +3 -3
- package/dist/esm/components/_internal/base-menu.props.d.ts +5 -0
- package/dist/esm/components/_internal/base-menu.props.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-menu.props.js +1 -1
- package/dist/esm/components/_internal/base-menu.props.js.map +3 -3
- package/dist/esm/components/_internal/base-tab-list.props.d.ts +5 -0
- package/dist/esm/components/_internal/base-tab-list.props.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-tab-list.props.js +1 -1
- package/dist/esm/components/_internal/base-tab-list.props.js.map +3 -3
- package/dist/esm/components/alert-dialog.d.ts.map +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/alert-dialog.js.map +3 -3
- package/dist/esm/components/avatar.d.ts.map +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/avatar.js.map +3 -3
- package/dist/esm/components/avatar.props.d.ts +6 -1
- package/dist/esm/components/avatar.props.d.ts.map +1 -1
- package/dist/esm/components/avatar.props.js +1 -1
- package/dist/esm/components/avatar.props.js.map +3 -3
- package/dist/esm/components/badge.d.ts.map +1 -1
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/badge.js.map +3 -3
- package/dist/esm/components/badge.props.d.ts +6 -1
- package/dist/esm/components/badge.props.d.ts.map +1 -1
- package/dist/esm/components/badge.props.js +1 -1
- package/dist/esm/components/badge.props.js.map +2 -2
- package/dist/esm/components/callout.d.ts.map +1 -1
- package/dist/esm/components/callout.js +1 -1
- package/dist/esm/components/callout.js.map +3 -3
- package/dist/esm/components/callout.props.d.ts +5 -0
- package/dist/esm/components/callout.props.d.ts.map +1 -1
- package/dist/esm/components/callout.props.js +1 -1
- package/dist/esm/components/callout.props.js.map +3 -3
- package/dist/esm/components/card.d.ts.map +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +3 -3
- package/dist/esm/components/card.props.d.ts +11 -2
- package/dist/esm/components/card.props.d.ts.map +1 -1
- package/dist/esm/components/card.props.js +1 -1
- package/dist/esm/components/card.props.js.map +3 -3
- package/dist/esm/components/context-menu.d.ts.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/context-menu.js.map +3 -3
- package/dist/esm/components/dialog.d.ts.map +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/dialog.props.d.ts +5 -0
- package/dist/esm/components/dialog.props.d.ts.map +1 -1
- package/dist/esm/components/dialog.props.js +1 -1
- package/dist/esm/components/dialog.props.js.map +3 -3
- package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.js.map +3 -3
- package/dist/esm/components/image.d.ts +6 -1
- package/dist/esm/components/image.d.ts.map +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/image.js.map +3 -3
- package/dist/esm/components/popover.d.ts.map +1 -1
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.js.map +3 -3
- package/dist/esm/components/popover.props.d.ts +5 -0
- package/dist/esm/components/popover.props.d.ts.map +1 -1
- package/dist/esm/components/popover.props.js +1 -1
- package/dist/esm/components/popover.props.js.map +3 -3
- package/dist/esm/components/select.d.ts.map +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/select.js.map +3 -3
- package/dist/esm/components/select.props.d.ts +6 -1
- package/dist/esm/components/select.props.d.ts.map +1 -1
- package/dist/esm/components/select.props.js +1 -1
- package/dist/esm/components/select.props.js.map +2 -2
- package/dist/esm/components/sidebar.d.ts +13 -2
- package/dist/esm/components/sidebar.d.ts.map +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/sidebar.js.map +3 -3
- package/dist/esm/components/sidebar.props.d.ts +5 -0
- package/dist/esm/components/sidebar.props.d.ts.map +1 -1
- package/dist/esm/components/sidebar.props.js +1 -1
- package/dist/esm/components/sidebar.props.js.map +2 -2
- package/dist/esm/components/tabs.d.ts.map +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +3 -3
- package/dist/esm/components/text-area.d.ts.map +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-area.js.map +3 -3
- package/dist/esm/components/text-area.props.d.ts +6 -1
- package/dist/esm/components/text-area.props.d.ts.map +1 -1
- package/dist/esm/components/text-area.props.js +1 -1
- package/dist/esm/components/text-area.props.js.map +3 -3
- package/dist/esm/components/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-field.js +2 -2
- package/dist/esm/components/text-field.js.map +3 -3
- package/dist/esm/components/text-field.props.d.ts +6 -1
- package/dist/esm/components/text-field.props.d.ts.map +1 -1
- package/dist/esm/components/text-field.props.js +1 -1
- package/dist/esm/components/text-field.props.js.map +3 -3
- package/dist/esm/components/theme.d.ts.map +1 -1
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.js.map +2 -2
- package/dist/esm/helpers/map-prop-values.js +1 -1
- package/dist/esm/helpers/map-prop-values.js.map +2 -2
- package/package.json +1 -1
- package/src/components/_internal/base-button.css +518 -110
- package/src/components/_internal/base-button.props.ts +5 -0
- package/src/components/_internal/base-button.tsx +4 -0
- package/src/components/_internal/base-card.css +59 -11
- package/src/components/_internal/base-dialog.css +26 -9
- package/src/components/_internal/base-menu.css +192 -21
- package/src/components/_internal/base-menu.props.ts +7 -0
- package/src/components/_internal/base-tab-list.css +56 -5
- package/src/components/_internal/base-tab-list.props.ts +3 -0
- package/src/components/alert-dialog.tsx +22 -7
- package/src/components/animations.css +31 -0
- package/src/components/avatar.css +436 -9
- package/src/components/avatar.props.tsx +4 -1
- package/src/components/avatar.tsx +19 -6
- package/src/components/badge.css +222 -7
- package/src/components/badge.props.tsx +3 -1
- package/src/components/badge.tsx +3 -2
- package/src/components/button.css +17 -17
- package/src/components/callout.css +75 -6
- package/src/components/callout.props.tsx +3 -0
- package/src/components/callout.tsx +6 -5
- package/src/components/card.css +361 -44
- package/src/components/card.props.tsx +7 -2
- package/src/components/card.tsx +7 -1
- package/src/components/context-menu.tsx +47 -22
- package/src/components/dialog.props.tsx +3 -0
- package/src/components/dialog.tsx +22 -7
- package/src/components/dropdown-menu.css +10 -10
- package/src/components/dropdown-menu.tsx +37 -11
- package/src/components/icon-button.css +36 -8
- package/src/components/image.tsx +92 -73
- package/src/components/kbd.css +122 -54
- package/src/components/popover.css +22 -3
- package/src/components/popover.props.tsx +3 -0
- package/src/components/popover.tsx +15 -8
- package/src/components/select.css +386 -95
- package/src/components/select.props.tsx +7 -1
- package/src/components/select.tsx +21 -13
- package/src/components/sidebar.css +201 -86
- package/src/components/sidebar.props.tsx +15 -3
- package/src/components/sidebar.tsx +306 -235
- package/src/components/tabs.css +3 -1
- package/src/components/tabs.tsx +8 -3
- package/src/components/text-area.css +323 -32
- package/src/components/text-area.props.tsx +4 -1
- package/src/components/text-area.tsx +3 -2
- package/src/components/text-field.css +336 -15
- package/src/components/text-field.props.tsx +4 -1
- package/src/components/text-field.tsx +5 -7
- package/src/components/theme.tsx +11 -9
- package/src/helpers/map-prop-values.ts +1 -1
- package/src/styles/tokens/color.css +19 -5
- package/src/styles/tokens/constants.css +118 -0
- package/src/styles/tokens/index.css +1 -0
- package/src/styles/tokens/radius.css +9 -6
- package/src/styles/tokens/shadow.css +10 -10
- package/src/styles/tokens/transition.css +33 -1
- package/styles.css +3846 -1089
- package/tokens/base.css +51 -22
- package/tokens.css +133 -34
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/select.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\n\nconst selectRootPropDefs = {\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n};\n\nconst triggerVariants = ['classic', 'surface', 'soft', 'ghost'] as const;\n\nconst selectTriggerPropDefs = {\n variant: { type: 'enum', className: 'rt-variant', values: triggerVariants, default: 'surface' },\n ...colorPropDef,\n ...radiusPropDef,\n placeholder: { type: 'string' },\n} satisfies {\n variant: PropDef<(typeof triggerVariants)[number]>;\n placeholder: PropDef<string>;\n};\n\nconst contentVariants = ['solid', 'soft'] as const;\n\nconst selectContentPropDefs = {\n variant: { type: 'enum', className: 'rt-variant', values: contentVariants, default: 'solid' },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n variant: PropDef<(typeof contentVariants)[number]>;\n};\n\nexport { selectRootPropDefs, selectTriggerPropDefs, selectContentPropDefs };\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,uBAAAC,EAAA,0BAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAA6B,kCAC7BC,EAAoC,0CACpCC,EAA8B,mCAI9B,MAAMC,EAAQ,CAAC,IAAK,IAAK,GAAG,EAEtBN,EAAqB,CACzB,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQM,EAAO,QAAS,IAAK,WAAY,EAAK,CAC9F,EAIMC,EAAkB,CAAC,UAAW,UAAW,OAAQ,OAAO,
|
|
4
|
+
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\n\nconst selectRootPropDefs = {\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n};\n\nconst triggerVariants = ['classic', 'surface', 'soft', 'outline', 'ghost'] as const;\n\nconst selectTriggerPropDefs = {\n variant: { type: 'enum', className: 'rt-variant', values: triggerVariants, default: 'surface' },\n panelBackground: {\n type: 'enum',\n className: 'rt-panel-background',\n values: ['solid', 'translucent'],\n },\n ...colorPropDef,\n ...radiusPropDef,\n placeholder: { type: 'string' },\n} satisfies {\n variant: PropDef<(typeof triggerVariants)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n placeholder: PropDef<string>;\n};\n\nconst contentVariants = ['solid', 'soft'] as const;\n\nconst selectContentPropDefs = {\n variant: { type: 'enum', className: 'rt-variant', values: contentVariants, default: 'solid' },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n variant: PropDef<(typeof contentVariants)[number]>;\n};\n\nexport { selectRootPropDefs, selectTriggerPropDefs, selectContentPropDefs };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,uBAAAC,EAAA,0BAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAA6B,kCAC7BC,EAAoC,0CACpCC,EAA8B,mCAI9B,MAAMC,EAAQ,CAAC,IAAK,IAAK,GAAG,EAEtBN,EAAqB,CACzB,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQM,EAAO,QAAS,IAAK,WAAY,EAAK,CAC9F,EAIMC,EAAkB,CAAC,UAAW,UAAW,OAAQ,UAAW,OAAO,EAEnEN,EAAwB,CAC5B,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQM,EAAiB,QAAS,SAAU,EAC9F,gBAAiB,CACf,KAAM,OACN,UAAW,sBACX,OAAQ,CAAC,QAAS,aAAa,CACjC,EACA,GAAG,eACH,GAAG,gBACH,YAAa,CAAE,KAAM,QAAS,CAChC,EAMMC,EAAkB,CAAC,QAAS,MAAM,EAElCT,EAAwB,CAC5B,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQS,EAAiB,QAAS,OAAQ,EAC5F,GAAG,eACH,GAAG,qBACL",
|
|
6
6
|
"names": ["select_props_exports", "__export", "selectContentPropDefs", "selectRootPropDefs", "selectTriggerPropDefs", "__toCommonJS", "import_color_prop", "import_high_contrast_prop", "import_radius_prop", "sizes", "triggerVariants", "contentVariants"]
|
|
7
7
|
}
|
|
@@ -2,9 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import { Accordion } from 'radix-ui';
|
|
3
3
|
import { sidebarPropDefs } from './sidebar.props';
|
|
4
4
|
import { IconButton } from './icon-button';
|
|
5
|
-
import { Separator } from './separator';
|
|
5
|
+
import { Separator } from './separator.js';
|
|
6
6
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props';
|
|
7
7
|
import type { GetPropDefTypes } from '../props/prop-def';
|
|
8
|
+
import type { BadgeProps } from './badge.js';
|
|
9
|
+
type BadgeConfig = {
|
|
10
|
+
content: React.ReactNode;
|
|
11
|
+
variant?: BadgeProps['variant'];
|
|
12
|
+
size?: BadgeProps['size'];
|
|
13
|
+
color?: BadgeProps['color'];
|
|
14
|
+
highContrast?: BadgeProps['highContrast'];
|
|
15
|
+
radius?: BadgeProps['radius'];
|
|
16
|
+
};
|
|
8
17
|
type SidebarContextProps = {
|
|
9
18
|
state: 'expanded' | 'collapsed';
|
|
10
19
|
open: boolean;
|
|
@@ -66,6 +75,8 @@ declare const SidebarMenuItem: React.ForwardRefExoticComponent<SidebarMenuItemPr
|
|
|
66
75
|
interface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
67
76
|
asChild?: boolean;
|
|
68
77
|
isActive?: boolean;
|
|
78
|
+
shortcut?: React.ReactNode;
|
|
79
|
+
badge?: string | BadgeConfig;
|
|
69
80
|
}
|
|
70
81
|
declare const SidebarMenuButton: React.ForwardRefExoticComponent<SidebarMenuButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
71
82
|
interface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
@@ -142,5 +153,5 @@ export { SidebarProvider as Provider, Sidebar as Root, SidebarContent as Content
|
|
|
142
153
|
* - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end
|
|
143
154
|
* - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4
|
|
144
155
|
*/
|
|
145
|
-
export type { SidebarProviderProps as ProviderProps, SidebarProps as RootProps, SidebarContentProps as ContentProps, SidebarHeaderProps as HeaderProps, SidebarFooterProps as FooterProps, SidebarTriggerProps as TriggerProps, };
|
|
156
|
+
export type { SidebarProviderProps as ProviderProps, SidebarProps as RootProps, SidebarContentProps as ContentProps, SidebarHeaderProps as HeaderProps, SidebarFooterProps as FooterProps, SidebarTriggerProps as TriggerProps, BadgeConfig, };
|
|
146
157
|
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM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AO,IAAI,IAAI,EACf,cAAc,IAAI,OAAO,EACzB,aAAa,IAAI,MAAM,EACvB,aAAa,IAAI,MAAM,EACvB,cAAc,IAAI,OAAO,EACzB,gBAAgB,IAAI,SAAS,EAC7B,WAAW,IAAI,IAAI,EACnB,eAAe,IAAI,QAAQ,EAC3B,iBAAiB,IAAI,UAAU,EAC/B,cAAc,IAAI,OAAO,EACzB,qBAAqB,IAAI,cAAc,EACvC,qBAAqB,IAAI,cAAc,EACvC,YAAY,IAAI,KAAK,EACrB,iBAAiB,IAAI,UAAU,EAC/B,mBAAmB,IAAI,YAAY,EAEnC,UAAU,GACX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,YAAY,EACV,oBAAoB,IAAI,aAAa,EACrC,YAAY,IAAI,SAAS,EACzB,mBAAmB,IAAI,YAAY,EACnC,kBAAkB,IAAI,WAAW,EACjC,kBAAkB,IAAI,WAAW,EACjC,mBAAmB,IAAI,YAAY,EACnC,WAAW,GACZ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var ae=Object.create;var H=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var pe=(o,t)=>{for(var r in t)H(o,r,{get:t[r],enumerable:!0})},Q=(o,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ie(t))!de.call(o,n)&&n!==r&&H(o,n,{get:()=>t[n],enumerable:!(a=ne(t,n))||a.enumerable});return o};var X=(o,t,r)=>(r=o!=null?ae(se(o)):{},Q(t||!o||!o.__esModule?H(r,"default",{value:o,enumerable:!0}):r,o)),le=o=>Q(H({},"__esModule",{value:!0}),o);var be={};pe(be,{Content:()=>W,Footer:()=>A,Group:()=>U,GroupContent:()=>J,GroupLabel:()=>q,Header:()=>D,Menu:()=>k,MenuButton:()=>V,MenuItem:()=>F,MenuSub:()=>_,MenuSubContent:()=>K,MenuSubTrigger:()=>j,Provider:()=>E,Root:()=>G,Separator:()=>O,Trigger:()=>$,useSidebar:()=>w});module.exports=le(be);var e=X(require("react")),i=X(require("classnames")),z=require("./slot"),y=require("radix-ui"),P=require("./sidebar.props"),x=require("./theme"),Y=require("./icon-button"),Z=require("./scroll-area.js"),ee=require("./separator.js"),R=require("./icons.js"),oe=require("../helpers/extract-props.js"),re=require("./kbd.js"),I=require("./badge.js");const h=e.createContext(null);function w(){const o=e.useContext(h);if(!o)throw new Error("useSidebar must be used within a SidebarProvider.");return o}function ue(){const[o,t]=e.useState(!1);return e.useEffect(()=>{const r=()=>{t(window.innerWidth<768)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),o}const E=e.forwardRef(({defaultOpen:o=!0,open:t,onOpenChange:r,side:a="left",className:n,children:s,...l},u)=>{const d=ue(),[S,c]=e.useState(!1),[b,v]=e.useState(o),p=t??b,g=e.useCallback(f=>{const B=typeof f=="function"?f(p):f;r?r(B):v(B)},[r,p]),m=e.useCallback(()=>d?c(f=>!f):g(f=>!f),[d,g,c]),T=p?"expanded":"collapsed",N=e.useMemo(()=>({state:T,open:p,setOpen:g,isMobile:d,openMobile:S,setOpenMobile:c,toggleSidebar:m,side:a}),[T,p,g,d,S,c,m,a]);return e.createElement("div",{...l,ref:u,className:(0,i.default)("rt-SidebarProvider",n),"data-state":T,"data-side":a},e.createElement(h.Provider,{value:N},s))});E.displayName="Sidebar.Provider";const G=e.forwardRef((o,t)=>{const r=(0,x.useThemeContext)(),{isMobile:a,state:n,openMobile:s,setOpenMobile:l}=w(),{size:u=P.sidebarPropDefs.size.default,variant:d=P.sidebarPropDefs.variant.default,menuVariant:S=P.sidebarPropDefs.menuVariant.default,type:c=P.sidebarPropDefs.type.default,side:b=P.sidebarPropDefs.side.default,collapsible:v=P.sidebarPropDefs.collapsible.default,panelBackground:p,color:g,highContrast:m=P.sidebarPropDefs.highContrast.default,asChild:T}=o,{className:N,children:f,...B}=(0,oe.extractProps)(o,P.sidebarPropDefs),{asChild:ce,panelBackground:fe,...L}=B,M=g||r.accentColor,te=typeof u=="object"?u.initial||"2":u,C=e.useContext(h);return C&&(C.side=b,C.type=c,C.variant=d,C.menuVariant=S,C.collapsible=v,C.size=te),v==="none"?e.createElement("div",{...L,ref:t,"data-accent-color":M,"data-state":n,"data-side":b,"data-type":c,"data-collapsible":v,className:(0,i.default)("rt-SidebarRoot",`rt-r-size-${u}`,N)},e.createElement(x.Theme,null,e.createElement("div",{className:(0,i.default)("rt-SidebarContainer",`rt-variant-${d}`),"data-accent-color":M,"data-high-contrast":m||void 0,"data-side":b,"data-panel-background":p},f))):a?e.createElement("div",{...L,ref:t,"data-accent-color":M,"data-state":s?"open":"closed","data-side":b,"data-type":c,"data-collapsible":v,className:(0,i.default)("rt-SidebarRoot","rt-SidebarRoot--mobile",N)},e.createElement(x.Theme,null,e.createElement("div",{className:(0,i.default)("rt-SidebarContainer",`rt-variant-${d}`,`rt-r-size-${u}`),"data-accent-color":M,"data-high-contrast":m||void 0,"data-side":b,"data-panel-background":p},f))):e.createElement("div",{...L,ref:t,"data-accent-color":M,"data-state":n,"data-side":b,"data-type":c,"data-collapsible":v,className:(0,i.default)("rt-SidebarRoot",N)},e.createElement(x.Theme,null,e.createElement("div",{className:(0,i.default)("rt-SidebarContainer",`rt-variant-${d}`,`rt-r-size-${u}`),"data-accent-color":M,"data-high-contrast":m||void 0,"data-side":b,"data-panel-background":p},f)))});G.displayName="Sidebar.Root";const W=e.forwardRef(({className:o,children:t,...r},a)=>{const n=e.useContext(h),{size:s="2",menuVariant:l="soft"}=n||{};return e.createElement(Z.ScrollArea,{type:"auto"},e.createElement("div",{...r,ref:a,className:(0,i.default)("rt-SidebarContent",`rt-r-size-${s}`,`rt-menu-variant-${l}`,o)},t))});W.displayName="Sidebar.Content";const D=e.forwardRef(({className:o,asContainer:t=!0,...r},a)=>{const n=e.useContext(h),{size:s="2",menuVariant:l="soft"}=n||{};return e.createElement("div",{...r,ref:a,className:(0,i.default)("rt-SidebarHeader",`rt-r-size-${s}`,`rt-menu-variant-${l}`,{"rt-SidebarHeader--container":t},o)})});D.displayName="Sidebar.Header";const A=e.forwardRef(({className:o,asContainer:t=!0,...r},a)=>{const n=e.useContext(h),{size:s="2",menuVariant:l="soft"}=n||{};return e.createElement("div",{...r,ref:a,className:(0,i.default)("rt-SidebarFooter",`rt-r-size-${s}`,`rt-menu-variant-${l}`,{"rt-SidebarFooter--container":t},o)})});A.displayName="Sidebar.Footer";const $=e.forwardRef(({onClick:o,children:t,...r},a)=>{const{toggleSidebar:n}=w();return e.createElement(Y.IconButton,{...r,ref:a,variant:"ghost",onClick:s=>{o?.(s),n()}},t||e.createElement(R.ChevronDownIcon,null))});$.displayName="Sidebar.Trigger";const O=e.forwardRef(({className:o,...t},r)=>e.createElement(ee.Separator,{...t,ref:r,className:(0,i.default)("rt-SidebarSeparator",o)}));O.displayName="Sidebar.Separator";const k=e.forwardRef(({className:o,...t},r)=>e.createElement("ul",{...t,ref:r,className:(0,i.default)("rt-SidebarMenu",o)}));k.displayName="Sidebar.Menu";const F=e.forwardRef(({className:o,...t},r)=>e.createElement("li",{...t,ref:r,className:(0,i.default)("rt-SidebarMenuItem",o)}));F.displayName="Sidebar.MenuItem";const V=e.forwardRef(({asChild:o=!1,isActive:t=!1,shortcut:r,badge:a,className:n,children:s,onMouseEnter:l,onMouseLeave:u,...d},S)=>{const[c,b]=e.useState(!1),v=e.useContext(h),{size:p="2"}=v||{};return e.createElement(o?z.Slot:"button",{...d,ref:S,className:(0,i.default)("rt-reset","rt-SidebarMenuButton",n),"data-active":t||void 0,"data-highlighted":c||void 0,onMouseEnter:m=>{b(!0),l?.(m)},onMouseLeave:m=>{b(!1),u?.(m)}},o?s:e.createElement(e.Fragment,null,s,a&&e.createElement("div",{className:"rt-SidebarMenuBadge"},typeof a=="string"?e.createElement(I.Badge,{size:p,variant:"soft"},a):e.createElement(I.Badge,{size:a.size||p,variant:a.variant||"soft",color:a.color,highContrast:a.highContrast,radius:a.radius},a.content)),r&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-SidebarMenuShortcut"},e.createElement(re.Kbd,{size:p},r))))});V.displayName="Sidebar.MenuButton";const _=e.forwardRef(({defaultOpen:o=!1,children:t,...r},a)=>e.createElement("div",{...r,ref:a},e.createElement(y.Accordion.Root,{type:"single",collapsible:!0,defaultValue:o?"item":void 0},e.createElement(y.Accordion.Item,{value:"item"},t))));_.displayName="Sidebar.MenuSub";const j=e.forwardRef(({asChild:o=!1,className:t,children:r,onMouseEnter:a,onMouseLeave:n,...s},l)=>{const[u,d]=e.useState(!1);return e.createElement(y.Accordion.Header,{asChild:!0},e.createElement("div",null,e.createElement(y.Accordion.Trigger,{...s,ref:l,asChild:o,className:(0,i.default)("rt-reset","rt-SidebarMenuButton","rt-SidebarMenuSubTrigger",t),"data-highlighted":u||void 0,onMouseEnter:S=>{d(!0),a?.(S)},onMouseLeave:S=>{d(!1),n?.(S)}},o?r:e.createElement(e.Fragment,null,r,e.createElement(R.ThickChevronRightIcon,{className:(0,i.default)("rt-BaseMenuSubTriggerIcon","rt-SidebarMenuSubTriggerIcon")})))))});j.displayName="Sidebar.MenuSubTrigger";const K=e.forwardRef(({className:o,children:t,...r},a)=>e.createElement(y.Accordion.Content,{...r,ref:a,className:(0,i.default)("rt-SidebarMenuSubContent",o)},e.createElement("div",{className:"rt-SidebarMenuSubList"},t)));K.displayName="Sidebar.MenuSubContent";const U=e.forwardRef(({className:o,...t},r)=>e.createElement("div",{...t,ref:r,className:(0,i.default)("rt-SidebarGroup",o)}));U.displayName="Sidebar.Group";const q=e.forwardRef(({asChild:o=!1,className:t,...r},a)=>e.createElement(o?z.Slot:"div",{...r,ref:a,className:(0,i.default)("rt-SidebarGroupLabel",t)}));q.displayName="Sidebar.GroupLabel";const J=e.forwardRef(({className:o,...t},r)=>e.createElement("div",{...t,ref:r,className:(0,i.default)("rt-SidebarGroupContent",o)}));J.displayName="Sidebar.GroupContent";
|
|
2
2
|
//# sourceMappingURL=sidebar.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot';\nimport { Accordion } from 'radix-ui';\n\nimport { sidebarPropDefs } from './sidebar.props';\nimport { Theme, useThemeContext } from './theme';\nimport { IconButton } from './icon-button';\nimport { ScrollArea } from './scroll-area';\nimport { Separator } from './separator';\nimport { ChevronDownIcon, ThickChevronRightIcon } from './icons';\nimport { extractProps } from '../helpers/extract-props';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props';\nimport type { GetPropDefTypes } from '../props/prop-def';\n\n// Sidebar context for state management\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n side: 'left' | 'right';\n type: 'sidebar' | 'floating';\n variant: 'soft' | 'surface' | 'ghost';\n menuVariant: 'solid' | 'soft';\n collapsible: 'offcanvas' | 'icon' | 'none';\n size: '1' | '2';\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n return context;\n}\n\n// Hook to detect mobile (simplified version)\nfunction useIsMobile() {\n const [isMobile, setIsMobile] = React.useState(false);\n \n React.useEffect(() => {\n const checkIsMobile = () => {\n setIsMobile(window.innerWidth < 768);\n };\n \n checkIsMobile();\n window.addEventListener('resize', checkIsMobile);\n return () => window.removeEventListener('resize', checkIsMobile);\n }, []);\n \n return isMobile;\n}\n\n// Provider component\ninterface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n side?: 'left' | 'right';\n}\n\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\n ({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, side = 'left', className, children, ...props }, forwardedRef) => {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n \n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n \n // Use controlled state if provided, otherwise internal state\n const open = openProp ?? internalOpen;\n \n const setOpen = React.useCallback((value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setInternalOpen(openState);\n }\n }, [setOpenProp, open]);\n\n // Helper to toggle the sidebar\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // State for data attributes\n const state = open ? 'expanded' : 'collapsed';\n \n const contextValue = React.useMemo<Partial<SidebarContextProps>>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n side,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, side]\n );\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarProvider', className)}\n data-state={state}\n data-side={side}\n >\n <SidebarContext.Provider value={contextValue as SidebarContextProps}>\n {children}\n </SidebarContext.Provider>\n </div>\n );\n }\n);\nSidebarProvider.displayName = 'Sidebar.Provider';\n\n// Main Sidebar component\ntype SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;\ninterface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {}\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\n (props, forwardedRef) => {\n const themeContext = useThemeContext();\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n const {\n size = sidebarPropDefs.size.default,\n variant = sidebarPropDefs.variant.default,\n menuVariant = sidebarPropDefs.menuVariant.default,\n type = sidebarPropDefs.type.default,\n side = sidebarPropDefs.side.default,\n collapsible = sidebarPropDefs.collapsible.default,\n color,\n highContrast = sidebarPropDefs.highContrast.default,\n asChild,\n } = props;\n\n const { className, children, ...rootProps } = extractProps(props, sidebarPropDefs);\n const { asChild: _, ...safeRootProps } = rootProps; // Remove asChild from DOM props\n const resolvedColor = color || themeContext.accentColor;\n\n // Update context with current props - we'll pass the resolved values\n const resolvedSize = typeof size === 'object' ? size.initial || '2' : size;\n const context = React.useContext(SidebarContext);\n if (context) {\n context.side = side;\n context.type = type;\n context.variant = variant;\n context.menuVariant = menuVariant;\n context.collapsible = collapsible;\n context.size = resolvedSize;\n }\n\n if (collapsible === 'none') {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', `rt-r-size-${size}`, className)}\n >\n <Theme>\n <div \n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={openMobile ? 'open' : 'closed'}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', 'rt-SidebarRoot--mobile', className)}\n >\n <Theme>\n <div \n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`, `rt-r-size-${size}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', className)}\n >\n <Theme>\n <div \n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`, `rt-r-size-${size}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n);\nSidebar.displayName = 'Sidebar.Root';\n\n// Sidebar content area\ninterface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n \n return (\n <ScrollArea type=\"auto\">\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarContent', \n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n className\n )}\n >\n {children}\n </div>\n </ScrollArea>\n );\n }\n);\nSidebarContent.displayName = 'Sidebar.Content';\n\n// Sidebar header\ninterface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n \n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarHeader',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarHeader--container': asContainer,\n },\n className\n )}\n />\n );\n }\n);\nSidebarHeader.displayName = 'Sidebar.Header';\n\n// Sidebar footer\ninterface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n \n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarFooter',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarFooter--container': asContainer,\n },\n className\n )}\n />\n );\n }\n);\nSidebarFooter.displayName = 'Sidebar.Footer';\n\n// Sidebar trigger button\ninterface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {}\n\nconst SidebarTrigger = React.forwardRef<\n React.ElementRef<typeof IconButton>,\n SidebarTriggerProps\n>(({ onClick, children, ...props }, forwardedRef) => {\n const { toggleSidebar } = useSidebar();\n \n return (\n <IconButton\n {...props}\n ref={forwardedRef}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n >\n {children || <ChevronDownIcon />}\n </IconButton>\n );\n});\nSidebarTrigger.displayName = 'Sidebar.Trigger';\n\n// Removed SidebarInset - not needed\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<\n React.ComponentRef<typeof Separator>,\n SidebarSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarSeparator', className)}\n />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - reusing dropdown menu structure\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, forwardedRef) => (\n <ul\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenu', className)}\n />\n )\n);\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ className, ...props }, forwardedRef) => (\n <li\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenuItem', className)}\n />\n )\n);\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, className, onMouseEnter, onMouseLeave, ...props }, forwardedRef) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n const Comp = asChild ? Slot : 'button';\n \n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-reset',\n 'rt-SidebarMenuButton',\n className\n )}\n data-active={isActive || undefined}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n />\n );\n }\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components using Radix Accordion\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(\n ({ defaultOpen = false, children, ...props }, forwardedRef) => {\n return (\n <div {...props} ref={forwardedRef}>\n <Accordion.Root\n type=\"single\"\n collapsible\n defaultValue={defaultOpen ? 'item' : undefined}\n >\n <Accordion.Item value=\"item\">\n {children}\n </Accordion.Item>\n </Accordion.Root>\n </div>\n );\n }\n);\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof Accordion.Trigger>,\n SidebarMenuSubTriggerProps\n>(({ asChild = false, className, children, onMouseEnter, onMouseLeave, ...props }, forwardedRef) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n \n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames(\n 'rt-reset',\n 'rt-SidebarMenuButton',\n 'rt-SidebarMenuSubTrigger',\n className\n )}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon \n className={classNames(\n 'rt-BaseMenuSubTriggerIcon',\n 'rt-SidebarMenuSubTriggerIcon'\n )}\n />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n});\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\nconst SidebarMenuSubContent = React.forwardRef<\n React.ElementRef<typeof Accordion.Content>,\n SidebarMenuSubContentProps\n>(({ className, children, ...props }, forwardedRef) => {\n return (\n <Accordion.Content\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenuSubContent', className)}\n >\n <div className=\"rt-SidebarMenuSubList\">\n {children}\n </div>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroup', className)}\n />\n )\n);\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\n ({ asChild = false, className, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n \n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupLabel', className)}\n />\n );\n }\n);\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupContent', className)}\n />\n )\n);\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarProvider as Provider,\n Sidebar as Root,\n SidebarContent as Content,\n SidebarHeader as Header,\n SidebarFooter as Footer,\n SidebarTrigger as Trigger,\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n // Export hook\n useSidebar,\n};\n\n/**\n * Enhanced Sidebar Header and Footer Usage Examples:\n * \n * 1. Simple default container (backwards compatible):\n * <Sidebar.Header>\n * <Logo />\n * <span>App Name</span>\n * </Sidebar.Header>\n * \n * 2. Custom flex layout:\n * <Sidebar.Header className=\"rt-justify-between rt-gap-3\">\n * <Logo />\n * <Sidebar.MenuButton>\n * <SettingsIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n * \n * 3. Column layout for multiple rows:\n * <Sidebar.Header className=\"rt-flex-col rt-gap-2\" asContainer={false}>\n * <div className=\"rt-flex rt-items-center rt-gap-2\">\n * <Logo />\n * <span>App Name</span>\n * </div>\n * <Sidebar.MenuButton>\n * <UserAvatar />\n * <span>John Doe</span>\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n * \n * 4. Interactive footer with menu button:\n * <Sidebar.Footer>\n * <Sidebar.MenuButton>\n * <UserIcon />\n * <span>Settings</span>\n * <ChevronUpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n * \n * 5. Custom footer layout:\n * <Sidebar.Footer className=\"rt-justify-between\">\n * <span>v1.0.0</span>\n * <Sidebar.MenuButton>\n * <HelpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n * \n * Available utility classes:\n * - Layout: rt-flex-row, rt-flex-col\n * - Alignment: rt-items-center, rt-items-start, rt-items-end\n * - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end\n * - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4\n */\n\nexport type {\n SidebarProviderProps as ProviderProps,\n SidebarProps as RootProps,\n SidebarContentProps as ContentProps,\n SidebarHeaderProps as HeaderProps,\n SidebarFooterProps as FooterProps,\n SidebarTriggerProps as TriggerProps,\n}; "],
|
|
5
|
-
"mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,EAAA,WAAAC,EAAA,UAAAC,EAAA,iBAAAC,EAAA,eAAAC,EAAA,WAAAC,EAAA,SAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,YAAAC,EAAA,mBAAAC,EAAA,mBAAAC,EAAA,aAAAC,EAAA,SAAAC,EAAA,cAAAC,EAAA,YAAAC,EAAA,eAAAC,IAAA,eAAAC,GAAAnB,IAEA,IAAAoB,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,kBACrBC,EAA0B,oBAE1BC,EAAgC,2BAChCC,EAAuC,mBACvCC,EAA2B,yBAC3BC,EAA2B,
|
|
6
|
-
"names": ["sidebar_exports", "__export", "SidebarContent", "SidebarFooter", "SidebarGroup", "SidebarGroupContent", "SidebarGroupLabel", "SidebarHeader", "SidebarMenu", "SidebarMenuButton", "SidebarMenuItem", "SidebarMenuSub", "SidebarMenuSubContent", "SidebarMenuSubTrigger", "SidebarProvider", "Sidebar", "SidebarSeparator", "SidebarTrigger", "useSidebar", "__toCommonJS", "React", "import_classnames", "import_slot", "import_radix_ui", "import_sidebar", "import_theme", "import_icon_button", "import_scroll_area", "import_separator", "import_icons", "import_extract_props", "SidebarContext", "context", "useIsMobile", "isMobile", "setIsMobile", "checkIsMobile", "defaultOpen", "openProp", "setOpenProp", "side", "className", "children", "props", "forwardedRef", "openMobile", "setOpenMobile", "internalOpen", "setInternalOpen", "open", "setOpen", "value", "openState", "toggleSidebar", "state", "contextValue", "classNames", "themeContext", "size", "variant", "menuVariant", "type", "collapsible", "color", "highContrast", "asChild", "rootProps", "_", "safeRootProps", "resolvedColor", "resolvedSize", "asContainer", "onClick", "event", "isActive", "onMouseEnter", "onMouseLeave", "isHighlighted", "setIsHighlighted"]
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot';\nimport { Accordion } from 'radix-ui';\n\nimport { sidebarPropDefs } from './sidebar.props';\nimport { Theme, useThemeContext } from './theme';\nimport { IconButton } from './icon-button';\nimport { ScrollArea } from './scroll-area.js';\nimport { Separator } from './separator.js';\nimport { ChevronDownIcon, ThickChevronRightIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { Kbd } from './kbd.js';\nimport { Badge } from './badge.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props';\nimport type { GetPropDefTypes } from '../props/prop-def';\nimport type { BadgeProps } from './badge.js';\n\n// Badge configuration type for sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: BadgeProps['variant'];\n size?: BadgeProps['size'];\n color?: BadgeProps['color'];\n highContrast?: BadgeProps['highContrast'];\n radius?: BadgeProps['radius'];\n};\n\n// Sidebar context for state management\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n side: 'left' | 'right';\n type: 'sidebar' | 'floating';\n variant: 'soft' | 'surface' | 'ghost';\n menuVariant: 'solid' | 'soft';\n collapsible: 'offcanvas' | 'icon' | 'none';\n size: '1' | '2';\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n return context;\n}\n\n// Hook to detect mobile (simplified version)\nfunction useIsMobile() {\n const [isMobile, setIsMobile] = React.useState(false);\n\n React.useEffect(() => {\n const checkIsMobile = () => {\n setIsMobile(window.innerWidth < 768);\n };\n\n checkIsMobile();\n window.addEventListener('resize', checkIsMobile);\n return () => window.removeEventListener('resize', checkIsMobile);\n }, []);\n\n return isMobile;\n}\n\n// Provider component\ninterface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n side?: 'left' | 'right';\n}\n\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n side = 'left',\n className,\n children,\n ...props\n },\n forwardedRef,\n ) => {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n\n // Use controlled state if provided, otherwise internal state\n const open = openProp ?? internalOpen;\n\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setInternalOpen(openState);\n }\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // State for data attributes\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = React.useMemo<Partial<SidebarContextProps>>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n side,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, side],\n );\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarProvider', className)}\n data-state={state}\n data-side={side}\n >\n <SidebarContext.Provider value={contextValue as SidebarContextProps}>\n {children}\n </SidebarContext.Provider>\n </div>\n );\n },\n);\nSidebarProvider.displayName = 'Sidebar.Provider';\n\n// Main Sidebar component\ntype SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;\ninterface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {}\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>((props, forwardedRef) => {\n const themeContext = useThemeContext();\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n const {\n size = sidebarPropDefs.size.default,\n variant = sidebarPropDefs.variant.default,\n menuVariant = sidebarPropDefs.menuVariant.default,\n type = sidebarPropDefs.type.default,\n side = sidebarPropDefs.side.default,\n collapsible = sidebarPropDefs.collapsible.default,\n panelBackground,\n color,\n highContrast = sidebarPropDefs.highContrast.default,\n asChild,\n } = props;\n\n const { className, children, ...rootProps } = extractProps(props, sidebarPropDefs);\n const { asChild: _, panelBackground: __, ...safeRootProps } = rootProps; // Remove asChild and panelBackground from DOM props\n const resolvedColor = color || themeContext.accentColor;\n\n // Update context with current props - we'll pass the resolved values\n const resolvedSize = typeof size === 'object' ? size.initial || '2' : size;\n const context = React.useContext(SidebarContext);\n if (context) {\n context.side = side;\n context.type = type;\n context.variant = variant;\n context.menuVariant = menuVariant;\n context.collapsible = collapsible;\n context.size = resolvedSize;\n }\n\n if (collapsible === 'none') {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', `rt-r-size-${size}`, className)}\n >\n <Theme>\n <div\n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={openMobile ? 'open' : 'closed'}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', 'rt-SidebarRoot--mobile', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n});\nSidebar.displayName = 'Sidebar.Root';\n\n// Sidebar content area\ninterface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <ScrollArea type=\"auto\">\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarContent',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n className,\n )}\n >\n {children}\n </div>\n </ScrollArea>\n );\n },\n);\nSidebarContent.displayName = 'Sidebar.Content';\n\n// Sidebar header\ninterface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarHeader',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarHeader--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarHeader.displayName = 'Sidebar.Header';\n\n// Sidebar footer\ninterface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarFooter',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarFooter--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarFooter.displayName = 'Sidebar.Footer';\n\n// Sidebar trigger button\ninterface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {}\n\nconst SidebarTrigger = React.forwardRef<React.ElementRef<typeof IconButton>, SidebarTriggerProps>(\n ({ onClick, children, ...props }, forwardedRef) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <IconButton\n {...props}\n ref={forwardedRef}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n >\n {children || <ChevronDownIcon />}\n </IconButton>\n );\n },\n);\nSidebarTrigger.displayName = 'Sidebar.Trigger';\n\n// Removed SidebarInset - not needed\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<\n React.ComponentRef<typeof Separator>,\n SidebarSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarSeparator', className)}\n />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - reusing dropdown menu structure\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, forwardedRef) => (\n <ul {...props} ref={forwardedRef} className={classNames('rt-SidebarMenu', className)} />\n ),\n);\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('rt-SidebarMenuItem', className)} />\n ),\n);\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n (\n {\n asChild = false,\n isActive = false,\n shortcut,\n badge,\n className,\n children,\n onMouseEnter,\n onMouseLeave,\n ...props\n },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n const context = React.useContext(SidebarContext);\n const { size: sidebarSize = '2' } = context || {};\n\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n {/* Badge with soft variant default and size mapping to sidebar size */}\n {badge && (\n <div className=\"rt-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Badge size={sidebarSize} variant=\"soft\">\n {badge}\n </Badge>\n ) : (\n <Badge\n size={badge.size || sidebarSize}\n variant={badge.variant || 'soft'}\n color={badge.color}\n highContrast={badge.highContrast}\n radius={badge.radius}\n >\n {badge.content}\n </Badge>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"rt-BaseMenuShortcut rt-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components using Radix Accordion\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(\n ({ defaultOpen = false, children, ...props }, forwardedRef) => {\n return (\n <div {...props} ref={forwardedRef}>\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </div>\n );\n },\n);\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof Accordion.Trigger>,\n SidebarMenuSubTriggerProps\n>(\n (\n { asChild = false, className, children, onMouseEnter, onMouseLeave, ...props },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames(\n 'rt-reset',\n 'rt-SidebarMenuButton',\n 'rt-SidebarMenuSubTrigger',\n className,\n )}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon\n className={classNames(\n 'rt-BaseMenuSubTriggerIcon',\n 'rt-SidebarMenuSubTriggerIcon',\n )}\n />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\nconst SidebarMenuSubContent = React.forwardRef<\n React.ElementRef<typeof Accordion.Content>,\n SidebarMenuSubContentProps\n>(({ className, children, ...props }, forwardedRef) => {\n return (\n <Accordion.Content\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenuSubContent', className)}\n >\n <div className=\"rt-SidebarMenuSubList\">{children}</div>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <div {...props} ref={forwardedRef} className={classNames('rt-SidebarGroup', className)} />\n ),\n);\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\n ({ asChild = false, className, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupLabel', className)}\n />\n );\n },\n);\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupContent', className)}\n />\n ),\n);\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarProvider as Provider,\n Sidebar as Root,\n SidebarContent as Content,\n SidebarHeader as Header,\n SidebarFooter as Footer,\n SidebarTrigger as Trigger,\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n // Export hook\n useSidebar,\n};\n\n/**\n * Enhanced Sidebar Header and Footer Usage Examples:\n *\n * 1. Simple default container (backwards compatible):\n * <Sidebar.Header>\n * <Logo />\n * <span>App Name</span>\n * </Sidebar.Header>\n *\n * 2. Custom flex layout:\n * <Sidebar.Header className=\"rt-justify-between rt-gap-3\">\n * <Logo />\n * <Sidebar.MenuButton>\n * <SettingsIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 3. Column layout for multiple rows:\n * <Sidebar.Header className=\"rt-flex-col rt-gap-2\" asContainer={false}>\n * <div className=\"rt-flex rt-items-center rt-gap-2\">\n * <Logo />\n * <span>App Name</span>\n * </div>\n * <Sidebar.MenuButton>\n * <UserAvatar />\n * <span>John Doe</span>\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 4. Interactive footer with menu button:\n * <Sidebar.Footer>\n * <Sidebar.MenuButton>\n * <UserIcon />\n * <span>Settings</span>\n * <ChevronUpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * 5. Custom footer layout:\n * <Sidebar.Footer className=\"rt-justify-between\">\n * <span>v1.0.0</span>\n * <Sidebar.MenuButton>\n * <HelpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * Available utility classes:\n * - Layout: rt-flex-row, rt-flex-col\n * - Alignment: rt-items-center, rt-items-start, rt-items-end\n * - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end\n * - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4\n */\n\nexport type {\n SidebarProviderProps as ProviderProps,\n SidebarProps as RootProps,\n SidebarContentProps as ContentProps,\n SidebarHeaderProps as HeaderProps,\n SidebarFooterProps as FooterProps,\n SidebarTriggerProps as TriggerProps,\n BadgeConfig,\n};\n"],
|
|
5
|
+
"mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,EAAA,WAAAC,EAAA,UAAAC,EAAA,iBAAAC,EAAA,eAAAC,EAAA,WAAAC,EAAA,SAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,YAAAC,EAAA,mBAAAC,EAAA,mBAAAC,EAAA,aAAAC,EAAA,SAAAC,EAAA,cAAAC,EAAA,YAAAC,EAAA,eAAAC,IAAA,eAAAC,GAAAnB,IAEA,IAAAoB,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,kBACrBC,EAA0B,oBAE1BC,EAAgC,2BAChCC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QAAAgD,EAAU,GAAO,UAAAzB,EAAW,GAAGE,CAAM,EAAGC,IAIvC1B,EAAA,cAHWgD,EAAU,OAAO,MAG3B,CACE,GAAGvB,EACJ,IAAKC,EACL,aAAW,EAAAY,SAAW,uBAAwBf,CAAS,EACzD,CAGN,EACArC,EAAkB,YAAc,qBAIhC,MAAMD,EAAsBe,EAAM,WAChC,CAAC,CAAE,UAAAuB,EAAW,GAAGE,CAAM,EAAGC,IACxB1B,EAAA,cAAC,OACE,GAAGyB,EACJ,IAAKC,EACL,aAAW,EAAAY,SAAW,yBAA0Bf,CAAS,EAC3D,CAEJ,EACAtC,EAAoB,YAAc",
|
|
6
|
+
"names": ["sidebar_exports", "__export", "SidebarContent", "SidebarFooter", "SidebarGroup", "SidebarGroupContent", "SidebarGroupLabel", "SidebarHeader", "SidebarMenu", "SidebarMenuButton", "SidebarMenuItem", "SidebarMenuSub", "SidebarMenuSubContent", "SidebarMenuSubTrigger", "SidebarProvider", "Sidebar", "SidebarSeparator", "SidebarTrigger", "useSidebar", "__toCommonJS", "React", "import_classnames", "import_slot", "import_radix_ui", "import_sidebar", "import_theme", "import_icon_button", "import_scroll_area", "import_separator", "import_icons", "import_extract_props", "import_kbd", "import_badge", "SidebarContext", "context", "useIsMobile", "isMobile", "setIsMobile", "checkIsMobile", "defaultOpen", "openProp", "setOpenProp", "side", "className", "children", "props", "forwardedRef", "openMobile", "setOpenMobile", "internalOpen", "setInternalOpen", "open", "setOpen", "value", "openState", "toggleSidebar", "state", "contextValue", "classNames", "themeContext", "size", "variant", "menuVariant", "type", "collapsible", "panelBackground", "color", "highContrast", "asChild", "rootProps", "_", "__", "safeRootProps", "resolvedColor", "resolvedSize", "asContainer", "onClick", "event", "isActive", "shortcut", "badge", "onMouseEnter", "onMouseLeave", "isHighlighted", "setIsHighlighted", "sidebarSize"]
|
|
7
7
|
}
|
|
@@ -47,6 +47,11 @@ declare const sidebarPropDefs: {
|
|
|
47
47
|
values: readonly ["offcanvas", "icon", "none"];
|
|
48
48
|
default: "offcanvas";
|
|
49
49
|
};
|
|
50
|
+
panelBackground: {
|
|
51
|
+
type: "enum";
|
|
52
|
+
values: ("solid" | "translucent")[];
|
|
53
|
+
default: undefined;
|
|
54
|
+
};
|
|
50
55
|
asChild: {
|
|
51
56
|
type: "boolean";
|
|
52
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.props.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar.props.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,uBAAuB,IAAI,sBAAsB,EACjD,oBAAoB,IAAI,mBAAmB,EAC3C,4BAA4B,IAAI,2BAA2B,EAC3D,yBAAyB,IAAI,wBAAwB,GACtD,MAAM,gCAAgC,CAAC;AAUxC,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"sidebar.props.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar.props.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,uBAAuB,IAAI,sBAAsB,EACjD,oBAAoB,IAAI,mBAAmB,EAC3C,4BAA4B,IAAI,2BAA2B,EAC3D,yBAAyB,IAAI,wBAAwB,GACtD,MAAM,gCAAgC,CAAC;AAUxC,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BpB,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(a,e)=>{for(var o in e)r(a,o,{get:e[o],enumerable:!0})},b=(a,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of m(e))!c.call(a,t)&&t!==o&&r(a,t,{get:()=>e[t],enumerable:!(n=u(e,t))||n.enumerable});return a};var D=a=>b(r({},"__esModule",{value:!0}),a);var I={};d(I,{sidebarCheckboxItemPropDefs:()=>s.baseMenuCheckboxItemPropDefs,sidebarContentPropDefs:()=>s.baseMenuContentPropDefs,sidebarItemPropDefs:()=>s.baseMenuItemPropDefs,sidebarPropDefs:()=>l,sidebarRadioItemPropDefs:()=>s.baseMenuRadioItemPropDefs});module.exports=D(I);var p=require("../props/as-child.prop"),f=require("../props/color.prop"),i=require("../props/high-contrast.prop"),s=require("./_internal/base-menu.props.js");const P=["1","2"],y=["soft","surface","ghost"],v=["solid","soft"],h=["sidebar","floating"],g=["left","right"],C=["offcanvas","icon","none"],l={...p.asChildPropDef,size:{type:"enum",className:"rt-r-size",values:P,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:y,default:"surface"},menuVariant:{type:"enum",className:"rt-menu-variant",values:v,default:"soft"},type:{type:"enum",className:"rt-type",values:h,default:"sidebar"},side:{type:"enum",className:"rt-side",values:g,default:"left"},collapsible:{type:"enum",className:"rt-collapsible",values:C,default:"offcanvas"},panelBackground:{type:"enum",values:["solid","translucent"],default:void 0},...f.colorPropDef,...i.highContrastPropDef};
|
|
2
2
|
//# sourceMappingURL=sidebar.props.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop';\nimport { colorPropDef } from '../props/color.prop';\nimport { highContrastPropDef } from '../props/high-contrast.prop';\n\nimport type { PropDef } from '../props/prop-def';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar', 'floating'] as const;\nconst sides = ['left', 'right'] as const;\nconst collapsibleModes = ['offcanvas', 'icon', 'none'] as const;\n\nconst sidebarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'surface' },\n menuVariant: {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wLAAAE,EAAA,0EAAAC,EAAAH,GAAA,IAAAI,EAA+B,kCAC/BC,EAA6B,+BAC7BC,EAAoC,uCAKpCC,EAKO,0CAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,OAAO,EACtCC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,UAAW,UAAU,EAC9BC,EAAQ,CAAC,OAAQ,OAAO,EACxBC,EAAmB,CAAC,YAAa,OAAQ,MAAM,EAE/CX,EAAkB,CACtB,GAAG,iBACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQM,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,YAAa,
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop';\nimport { colorPropDef } from '../props/color.prop';\nimport { highContrastPropDef } from '../props/high-contrast.prop';\n\nimport type { PropDef } from '../props/prop-def';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar', 'floating'] as const;\nconst sides = ['left', 'right'] as const;\nconst collapsibleModes = ['offcanvas', 'icon', 'none'] as const;\n\nconst sidebarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'surface' },\n menuVariant: {\n type: 'enum',\n className: 'rt-menu-variant',\n values: menuVariants,\n default: 'soft',\n },\n type: { type: 'enum', className: 'rt-type', values: types, default: 'sidebar' },\n side: { type: 'enum', className: 'rt-side', values: sides, default: 'left' },\n collapsible: {\n type: 'enum',\n className: 'rt-collapsible',\n values: collapsibleModes,\n default: 'offcanvas',\n },\n panelBackground: { type: 'enum', values: ['solid', 'translucent'], default: undefined },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n menuVariant: PropDef<(typeof menuVariants)[number]>;\n type: PropDef<(typeof types)[number]>;\n side: PropDef<(typeof sides)[number]>;\n collapsible: PropDef<(typeof collapsibleModes)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n};\n\nexport { sidebarPropDefs };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wLAAAE,EAAA,0EAAAC,EAAAH,GAAA,IAAAI,EAA+B,kCAC/BC,EAA6B,+BAC7BC,EAAoC,uCAKpCC,EAKO,0CAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,OAAO,EACtCC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,UAAW,UAAU,EAC9BC,EAAQ,CAAC,OAAQ,OAAO,EACxBC,EAAmB,CAAC,YAAa,OAAQ,MAAM,EAE/CX,EAAkB,CACtB,GAAG,iBACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQM,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,YAAa,CACX,KAAM,OACN,UAAW,kBACX,OAAQC,EACR,QAAS,MACX,EACA,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,SAAU,EAC9E,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,MAAO,EAC3E,YAAa,CACX,KAAM,OACN,UAAW,iBACX,OAAQC,EACR,QAAS,WACX,EACA,gBAAiB,CAAE,KAAM,OAAQ,OAAQ,CAAC,QAAS,aAAa,EAAG,QAAS,MAAU,EACtF,GAAG,eACH,GAAG,qBACL",
|
|
6
6
|
"names": ["sidebar_props_exports", "__export", "sidebarPropDefs", "__toCommonJS", "import_as_child", "import_color", "import_high_contrast", "import_base_menu_props", "sizes", "variants", "menuVariants", "types", "sides", "collapsibleModes"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,CAAC;A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O,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,EACpE,WAAW,EACX,gBAAgB;CAAG;AACvB,QAAA,MAAM,QAAQ,sFAgBZ,CAAC;AAIH,UAAU,gBACR,SAAQ,qBAAqB,CAAC,OAAO,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC;CAAG;AAC9E,QAAA,MAAM,WAAW,4FAiBhB,CAAC;AAIF,KAAK,mBAAmB,GAAG,eAAe,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACvE,UAAU,gBACR,SAAQ,qBAAqB,CAAC,OAAO,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,EACvE,WAAW,EACX,mBAAmB;CAAG;AAC1B,QAAA,MAAM,WAAW,yFAWhB,CAAC;AAGF,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,QAAQ,IAAI,IAAI,EAAE,WAAW,IAAI,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,CAAC;AAC9F,YAAY,EACV,aAAa,IAAI,SAAS,EAC1B,aAAa,IAAI,SAAS,EAC1B,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,IAAI,YAAY,GACjC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var R=Object.create;var i=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var u=(s,e)=>{for(var t in e)i(s,t,{get:e[t],enumerable:!0})},l=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of L(e))!v.call(s,a)&&a!==t&&i(s,a,{get:()=>e[a],enumerable:!(o=C(e,a))||o.enumerable});return s};var c=(s,e,t)=>(t=s!=null?R(N(s)):{},l(e||!s||!s.__esModule?i(t,"default",{value:s,enumerable:!0}):t,s)),E=s=>l(i({},"__esModule",{value:!0}),s);var h={};u(h,{Content:()=>g,List:()=>P,Root:()=>b,Trigger:()=>f});module.exports=E(h);var r=c(require("react")),p=c(require("classnames")),n=require("radix-ui"),d=require("./tabs.props.js"),T=require("../helpers/extract-props.js"),m=require("../props/margin.props.js");const b=r.forwardRef((s,e)=>{const{className:t,...o}=(0,T.extractProps)(s,m.marginPropDefs);return r.createElement(n.Tabs.Root,{...o,ref:e,className:(0,p.default)("rt-TabsRoot",t)})});b.displayName="Tabs.Root";const P=r.forwardRef((s,e)=>{const{className:t,color:o,panelBackground:a,...y}=(0,T.extractProps)(s,d.tabsListPropDefs,m.marginPropDefs);return r.createElement(n.Tabs.List,{"data-accent-color":o,"data-panel-background":a,...y,asChild:!1,ref:e,className:(0,p.default)("rt-BaseTabList","rt-TabsList",t)})});P.displayName="Tabs.List";const f=r.forwardRef((s,e)=>{const{className:t,children:o,...a}=s;return r.createElement(n.Tabs.Trigger,{...a,asChild:!1,ref:e,className:(0,p.default)("rt-reset","rt-BaseTabListTrigger","rt-TabsTrigger",t)},r.createElement("span",{className:"rt-BaseTabListTriggerInner rt-TabsTriggerInner"},o),r.createElement("span",{className:"rt-BaseTabListTriggerInnerHidden rt-TabsTriggerInnerHidden"},o))});f.displayName="Tabs.Trigger";const g=r.forwardRef((s,e)=>{const{className:t,...o}=(0,T.extractProps)(s,m.marginPropDefs);return r.createElement(n.Tabs.Content,{...o,ref:e,className:(0,p.default)("rt-TabsContent",t)})});g.displayName="Tabs.Content";
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/tabs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\n\nimport { tabsListPropDefs } from './tabs.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { tabsContentPropDefs, tabsRootPropDefs } from './tabs.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TabsRootElement = React.ElementRef<typeof TabsPrimitive.Root>;\ntype TabsRootOwnProps = GetPropDefTypes<typeof tabsRootPropDefs>;\ninterface TabsRootProps\n extends ComponentPropsWithout<typeof TabsPrimitive.Root, 'asChild' | 'color' | 'defaultChecked'>,\n MarginProps,\n TabsRootOwnProps {}\nconst TabsRoot = React.forwardRef<TabsRootElement, TabsRootProps>((props, forwardedRef) => {\n const { className, ...rootProps } = extractProps(props, marginPropDefs);\n return (\n <TabsPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n className={classNames('rt-TabsRoot', className)}\n />\n );\n});\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsListElement = React.ElementRef<typeof TabsPrimitive.List>;\ntype TabsListOwnProps = GetPropDefTypes<typeof tabsListPropDefs>;\ninterface TabsListProps\n extends ComponentPropsWithout<typeof TabsPrimitive.List, RemovedProps>,\n MarginProps,\n TabsListOwnProps {}\nconst TabsList = React.forwardRef<TabsListElement, TabsListProps>((props, forwardedRef) => {\n const { className, color, ...listProps } = extractProps(props
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,SAAAC,EAAA,SAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAN,GAAA,IAAAO,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAsC,oBAEtCC,EAAiC,2BACjCC,EAA6B,uCAC7BC,EAA+B,oCAa/B,MAAMR,EAAWG,EAAM,WAA2C,CAACM,EAAOC,IAAiB,CACzF,KAAM,CAAE,UAAAC,EAAW,GAAGC,CAAU,KAAI,gBAAaH,EAAO,gBAAc,EACtE,OACEN,EAAA,cAAC,EAAAU,KAAc,KAAd,CACE,GAAGD,EACJ,IAAKF,EACL,aAAW,EAAAI,SAAW,cAAeH,CAAS,EAChD,CAEJ,CAAC,EACDX,EAAS,YAAc,YAQvB,MAAMD,EAAWI,EAAM,WAA2C,CAACM,EAAOC,IAAiB,CACzF,KAAM,CAAE,UAAAC,EAAW,MAAAI,EAAO,GAAGC,CAAU,KAAI,
|
|
6
|
-
"names": ["tabs_exports", "__export", "TabsContent", "TabsList", "TabsRoot", "TabsTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_tabs_props", "import_extract_props", "import_margin_props", "props", "forwardedRef", "className", "rootProps", "TabsPrimitive", "classNames", "color", "listProps", "children", "triggerProps", "contentProps"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\n\nimport { tabsListPropDefs } from './tabs.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { tabsContentPropDefs, tabsRootPropDefs } from './tabs.props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TabsRootElement = React.ElementRef<typeof TabsPrimitive.Root>;\ntype TabsRootOwnProps = GetPropDefTypes<typeof tabsRootPropDefs>;\ninterface TabsRootProps\n extends ComponentPropsWithout<typeof TabsPrimitive.Root, 'asChild' | 'color' | 'defaultChecked'>,\n MarginProps,\n TabsRootOwnProps {}\nconst TabsRoot = React.forwardRef<TabsRootElement, TabsRootProps>((props, forwardedRef) => {\n const { className, ...rootProps } = extractProps(props, marginPropDefs);\n return (\n <TabsPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n className={classNames('rt-TabsRoot', className)}\n />\n );\n});\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsListElement = React.ElementRef<typeof TabsPrimitive.List>;\ntype TabsListOwnProps = GetPropDefTypes<typeof tabsListPropDefs>;\ninterface TabsListProps\n extends ComponentPropsWithout<typeof TabsPrimitive.List, RemovedProps>,\n MarginProps,\n TabsListOwnProps {}\nconst TabsList = React.forwardRef<TabsListElement, TabsListProps>((props, forwardedRef) => {\n const { className, color, panelBackground, ...listProps } = extractProps(\n props,\n tabsListPropDefs,\n marginPropDefs,\n );\n return (\n <TabsPrimitive.List\n data-accent-color={color}\n data-panel-background={panelBackground}\n {...listProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseTabList', 'rt-TabsList', className)}\n />\n );\n});\nTabsList.displayName = 'Tabs.List';\n\ntype TabsTriggerElement = React.ElementRef<typeof TabsPrimitive.Trigger>;\ninterface TabsTriggerProps\n extends ComponentPropsWithout<typeof TabsPrimitive.Trigger, RemovedProps> {}\nconst TabsTrigger = React.forwardRef<TabsTriggerElement, TabsTriggerProps>(\n (props, forwardedRef) => {\n const { className, children, ...triggerProps } = props;\n return (\n <TabsPrimitive.Trigger\n {...triggerProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-BaseTabListTrigger', 'rt-TabsTrigger', className)}\n >\n <span className=\"rt-BaseTabListTriggerInner rt-TabsTriggerInner\">{children}</span>\n <span className=\"rt-BaseTabListTriggerInnerHidden rt-TabsTriggerInnerHidden\">\n {children}\n </span>\n </TabsPrimitive.Trigger>\n );\n },\n);\nTabsTrigger.displayName = 'Tabs.Trigger';\n\ntype TabsContentElement = React.ElementRef<typeof TabsPrimitive.Content>;\ntype TabsContentOwnProps = GetPropDefTypes<typeof tabsContentPropDefs>;\ninterface TabsContentProps\n extends ComponentPropsWithout<typeof TabsPrimitive.Content, RemovedProps>,\n MarginProps,\n TabsContentOwnProps {}\nconst TabsContent = React.forwardRef<TabsContentElement, TabsContentProps>(\n (props, forwardedRef) => {\n const { className, ...contentProps } = extractProps(props, marginPropDefs);\n return (\n <TabsPrimitive.Content\n {...contentProps}\n ref={forwardedRef}\n className={classNames('rt-TabsContent', className)}\n />\n );\n },\n);\nTabsContent.displayName = 'Tabs.Content';\n\nexport { TabsRoot as Root, TabsList as List, TabsTrigger as Trigger, TabsContent as Content };\nexport type {\n TabsRootProps as RootProps,\n TabsListProps as ListProps,\n TabsTriggerProps as TriggerProps,\n TabsContentProps as ContentProps,\n};\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,SAAAC,EAAA,SAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAN,GAAA,IAAAO,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAsC,oBAEtCC,EAAiC,2BACjCC,EAA6B,uCAC7BC,EAA+B,oCAa/B,MAAMR,EAAWG,EAAM,WAA2C,CAACM,EAAOC,IAAiB,CACzF,KAAM,CAAE,UAAAC,EAAW,GAAGC,CAAU,KAAI,gBAAaH,EAAO,gBAAc,EACtE,OACEN,EAAA,cAAC,EAAAU,KAAc,KAAd,CACE,GAAGD,EACJ,IAAKF,EACL,aAAW,EAAAI,SAAW,cAAeH,CAAS,EAChD,CAEJ,CAAC,EACDX,EAAS,YAAc,YAQvB,MAAMD,EAAWI,EAAM,WAA2C,CAACM,EAAOC,IAAiB,CACzF,KAAM,CAAE,UAAAC,EAAW,MAAAI,EAAO,gBAAAC,EAAiB,GAAGC,CAAU,KAAI,gBAC1DR,EACA,mBACA,gBACF,EACA,OACEN,EAAA,cAAC,EAAAU,KAAc,KAAd,CACC,oBAAmBE,EACnB,wBAAuBC,EACtB,GAAGC,EACJ,QAAS,GACT,IAAKP,EACL,aAAW,EAAAI,SAAW,iBAAkB,cAAeH,CAAS,EAClE,CAEJ,CAAC,EACDZ,EAAS,YAAc,YAKvB,MAAME,EAAcE,EAAM,WACxB,CAACM,EAAOC,IAAiB,CACvB,KAAM,CAAE,UAAAC,EAAW,SAAAO,EAAU,GAAGC,CAAa,EAAIV,EACjD,OACEN,EAAA,cAAC,EAAAU,KAAc,QAAd,CACE,GAAGM,EACJ,QAAS,GACT,IAAKT,EACL,aAAW,EAAAI,SAAW,WAAY,wBAAyB,iBAAkBH,CAAS,GAEtFR,EAAA,cAAC,QAAK,UAAU,kDAAkDe,CAAS,EAC3Ef,EAAA,cAAC,QAAK,UAAU,8DACbe,CACH,CACF,CAEJ,CACF,EACAjB,EAAY,YAAc,eAQ1B,MAAMH,EAAcK,EAAM,WACxB,CAACM,EAAOC,IAAiB,CACvB,KAAM,CAAE,UAAAC,EAAW,GAAGS,CAAa,KAAI,gBAAaX,EAAO,gBAAc,EACzE,OACEN,EAAA,cAAC,EAAAU,KAAc,QAAd,CACE,GAAGO,EACJ,IAAKV,EACL,aAAW,EAAAI,SAAW,iBAAkBH,CAAS,EACnD,CAEJ,CACF,EACAb,EAAY,YAAc",
|
|
6
|
+
"names": ["tabs_exports", "__export", "TabsContent", "TabsList", "TabsRoot", "TabsTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_tabs_props", "import_extract_props", "import_margin_props", "props", "forwardedRef", "className", "rootProps", "TabsPrimitive", "classNames", "color", "panelBackground", "listProps", "children", "triggerProps", "contentProps"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../src/components/text-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,GAAG;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,UAAU,aACR,SAAQ,qBAAqB,CAAC,UAAU,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,EACxE,WAAW,EACX,gBAAgB;CAAG;AACvB,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../src/components/text-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,gBAAgB,GAAG,eAAe,CAAC,OAAO,gBAAgB,CAAC,GAAG;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,UAAU,aACR,SAAQ,qBAAqB,CAAC,UAAU,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,EACxE,WAAW,EACX,gBAAgB;CAAG;AACvB,QAAA,MAAM,QAAQ,2FAiBZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var T=Object.create;var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var D=(e,r)=>{for(var t in r)p(e,t,{get:r[t],enumerable:!0})},n=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of y(r))!v.call(e,o)&&o!==t&&p(e,o,{get:()=>r[o],enumerable:!(a=u(r,o))||a.enumerable});return e};var i=(e,r,t)=>(t=e!=null?T(g(e)):{},n(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),N=e=>n(p({},"__esModule",{value:!0}),e);var R={};D(R,{TextArea:()=>m});module.exports=N(R);var s=i(require("react")),f=i(require("classnames")),x=require("./text-area.props.js"),l=require("../helpers/extract-props.js"),P=require("../props/margin.props.js");const m=s.forwardRef((e,r)=>{const{className:t,color:a,radius:o,panelBackground:d,style:c,...A}=(0,l.extractProps)(e,x.textAreaPropDefs,P.marginPropDefs);return s.createElement("div",{"data-accent-color":a,"data-radius":o,"data-panel-background":d,className:(0,f.default)("rt-TextAreaRoot",t),style:c},s.createElement("textarea",{className:"rt-reset rt-TextAreaInput",ref:r,...A}))});m.displayName="TextArea";
|
|
2
2
|
//# sourceMappingURL=text-area.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/text-area.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { textAreaPropDefs } from './text-area.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TextAreaElement = React.ElementRef<'textarea'>;\ntype TextAreaOwnProps = GetPropDefTypes<typeof textAreaPropDefs> & {\n defaultValue?: string;\n value?: string;\n};\ninterface TextAreaProps\n extends ComponentPropsWithout<'textarea', RemovedProps | 'size' | 'value'>,\n MarginProps,\n TextAreaOwnProps {}\nconst TextArea = React.forwardRef<TextAreaElement, TextAreaProps>((props, forwardedRef) => {\n const { className, color, radius, style, ...textAreaProps } = extractProps(\n props,\n textAreaPropDefs,\n marginPropDefs
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAAiC,gCACjCC,EAA6B,uCAC7BC,EAA+B,oCAe/B,MAAMN,EAAWE,EAAM,WAA2C,CAACK,EAAOC,IAAiB,CACzF,KAAM,CAAE,UAAAC,EAAW,MAAAC,EAAO,OAAAC,EAAQ,MAAAC,EAAO,GAAGC,CAAc,KAAI,
|
|
6
|
-
"names": ["text_area_exports", "__export", "TextArea", "__toCommonJS", "React", "import_classnames", "import_text_area_props", "import_extract_props", "import_margin_props", "props", "forwardedRef", "className", "color", "radius", "style", "textAreaProps", "classNames"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { textAreaPropDefs } from './text-area.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TextAreaElement = React.ElementRef<'textarea'>;\ntype TextAreaOwnProps = GetPropDefTypes<typeof textAreaPropDefs> & {\n defaultValue?: string;\n value?: string;\n};\ninterface TextAreaProps\n extends ComponentPropsWithout<'textarea', RemovedProps | 'size' | 'value'>,\n MarginProps,\n TextAreaOwnProps {}\nconst TextArea = React.forwardRef<TextAreaElement, TextAreaProps>((props, forwardedRef) => {\n const { className, color, radius, panelBackground, style, ...textAreaProps } = extractProps(\n props,\n textAreaPropDefs,\n marginPropDefs,\n );\n return (\n <div\n data-accent-color={color}\n data-radius={radius}\n data-panel-background={panelBackground}\n className={classNames('rt-TextAreaRoot', className)}\n style={style}\n >\n <textarea className=\"rt-reset rt-TextAreaInput\" ref={forwardedRef} {...textAreaProps} />\n </div>\n );\n});\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\nexport type { TextAreaProps };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAAiC,gCACjCC,EAA6B,uCAC7BC,EAA+B,oCAe/B,MAAMN,EAAWE,EAAM,WAA2C,CAACK,EAAOC,IAAiB,CACzF,KAAM,CAAE,UAAAC,EAAW,MAAAC,EAAO,OAAAC,EAAQ,gBAAAC,EAAiB,MAAAC,EAAO,GAAGC,CAAc,KAAI,gBAC7EP,EACA,mBACA,gBACF,EACA,OACEL,EAAA,cAAC,OACC,oBAAmBQ,EACnB,cAAaC,EACb,wBAAuBC,EACvB,aAAW,EAAAG,SAAW,kBAAmBN,CAAS,EAClD,MAAOI,GAEPX,EAAA,cAAC,YAAS,UAAU,4BAA4B,IAAKM,EAAe,GAAGM,EAAe,CACxF,CAEJ,CAAC,EACDd,EAAS,YAAc",
|
|
6
|
+
"names": ["text_area_exports", "__export", "TextArea", "__toCommonJS", "React", "import_classnames", "import_text_area_props", "import_extract_props", "import_margin_props", "props", "forwardedRef", "className", "color", "radius", "panelBackground", "style", "textAreaProps", "classNames"]
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ declare const textAreaPropDefs: {
|
|
|
19
19
|
variant: {
|
|
20
20
|
type: "enum";
|
|
21
21
|
className: string;
|
|
22
|
-
values: readonly ["classic", "surface", "soft"];
|
|
22
|
+
values: readonly ["classic", "surface", "soft", "outline", "ghost"];
|
|
23
23
|
default: "surface";
|
|
24
24
|
};
|
|
25
25
|
resize: {
|
|
@@ -28,6 +28,11 @@ declare const textAreaPropDefs: {
|
|
|
28
28
|
values: readonly ["none", "vertical", "horizontal", "both"];
|
|
29
29
|
responsive: true;
|
|
30
30
|
};
|
|
31
|
+
panelBackground: {
|
|
32
|
+
type: "enum";
|
|
33
|
+
values: readonly ["solid", "translucent"];
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
31
36
|
};
|
|
32
37
|
export { textAreaPropDefs };
|
|
33
38
|
//# sourceMappingURL=text-area.props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.props.d.ts","sourceRoot":"","sources":["../../../src/components/text-area.props.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-area.props.d.ts","sourceRoot":"","sources":["../../../src/components/text-area.props.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYjB,CAAC;AAEN,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(s,e)=>{for(var a in e)o(s,a,{get:e[a],enumerable:!0})},m=(s,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!c.call(s,r)&&r!==a&&o(s,r,{get:()=>e[r],enumerable:!(t=u(e,r))||t.enumerable});return s};var d=s=>m(o({},"__esModule",{value:!0}),s);var P={};l(P,{textAreaPropDefs:()=>i});module.exports=d(P);var n=require("../props/color.prop.js"),p=require("../props/radius.prop.js");const v=["1","2","3"],z=["classic","surface","soft","outline","ghost"],y=["none","vertical","horizontal","both"],D=["solid","translucent"],i={size:{type:"enum",className:"rt-r-size",values:v,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:z,default:"surface"},resize:{type:"enum",className:"rt-r-resize",values:y,responsive:!0},panelBackground:{type:"enum",values:D,default:void 0},...n.colorPropDef,...p.radiusPropDef};
|
|
2
2
|
//# sourceMappingURL=text-area.props.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/text-area.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\nconst variants = ['classic', 'surface', 'soft'] as const;\nconst resizeValues = ['none', 'vertical', 'horizontal', 'both'] as const;\n\n// prettier-ignore\nconst textAreaPropDefs = {\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'surface' },\n resize: { type: 'enum', className: 'rt-r-resize', values: resizeValues, responsive: true },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n resize: PropDef<(typeof resizeValues)[number]>;\n };\n\nexport { textAreaPropDefs };\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA6B,kCAC7BC,EAA8B,mCAI9B,MAAMC,EAAQ,CAAC,IAAK,IAAK,GAAG,EACtBC,EAAW,CAAC,UAAW,UAAW,
|
|
6
|
-
"names": ["text_area_props_exports", "__export", "textAreaPropDefs", "__toCommonJS", "import_color_prop", "import_radius_prop", "sizes", "variants", "resizeValues"]
|
|
4
|
+
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\nconst variants = ['classic', 'surface', 'soft', 'outline', 'ghost'] as const;\nconst resizeValues = ['none', 'vertical', 'horizontal', 'both'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\n\n// prettier-ignore\nconst textAreaPropDefs = {\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'surface' },\n resize: { type: 'enum', className: 'rt-r-resize', values: resizeValues, responsive: true },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n resize: PropDef<(typeof resizeValues)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n };\n\nexport { textAreaPropDefs };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA6B,kCAC7BC,EAA8B,mCAI9B,MAAMC,EAAQ,CAAC,IAAK,IAAK,GAAG,EACtBC,EAAW,CAAC,UAAW,UAAW,OAAQ,UAAW,OAAO,EAC5DC,EAAe,CAAC,OAAQ,WAAY,aAAc,MAAM,EACxDC,EAAmB,CAAC,QAAS,aAAa,EAG1CP,EAAmB,CACvB,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQI,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,OAAQ,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQC,EAAe,WAAY,EAAK,EAC1F,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,GAAG,eACH,GAAG,eACL",
|
|
6
|
+
"names": ["text_area_props_exports", "__export", "textAreaPropDefs", "__toCommonJS", "import_color_prop", "import_radius_prop", "sizes", "variants", "resizeValues", "panelBackgrounds"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../src/components/text-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAIrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;A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AAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EACD,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,CAAC;CACZ,CAAC;AACF,KAAK,mBAAmB,GAAG,qBAAqB,CAC9C,OAAO,EACP,yBAAyB,GAAG,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CACjF,CAAC;AACF,UAAU,kBAAmB,SAAQ,mBAAmB,EAAE,WAAW,EAAE,qBAAqB;CAAG;AAC/F,QAAA,MAAM,aAAa,6FA+ClB,CAAC;AAIF,KAAK,qBAAqB,GAAG,eAAe,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC3E,UAAU,kBACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,EAChD,qBAAqB;CAAG;AAC5B,QAAA,MAAM,aAAa,2FAalB,CAAC;AAGF,OAAO,EAAE,aAAa,IAAI,IAAI,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;AACxD,YAAY,EAAE,kBAAkB,IAAI,SAAS,EAAE,kBAAkB,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var N=Object.create;var i=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var I=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},P=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!E.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(s=w(e,r))||s.enumerable});return t};var T=(t,e,o)=>(o=t!=null?N(b(t)):{},P(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t)),j=t=>P(i({},"__esModule",{value:!0}),t);var k={};I(k,{Root:()=>u,Slot:()=>c});module.exports=j(k);var l=T(require("react")),d=T(require("classnames")),F=require("radix-ui/internal"),n=require("./text-field.props.js"),m=require("../helpers/extract-props.js"),R=require("../props/margin.props.js");const u=l.forwardRef((t,e)=>{const o=l.useRef(null),{children:s,className:r,color:a,radius:y,panelBackground:S,style:g,...h}=(0,m.extractProps)(t,n.textFieldRootPropDefs,R.marginPropDefs);return l.createElement("div",{"data-accent-color":a,"data-radius":y,"data-panel-background":S,style:g,className:(0,d.default)("rt-TextFieldRoot",r),onPointerDown:v=>{const f=v.target;if(f.closest("input, button, a"))return;const p=o.current;if(!p)return;const x=f.closest(`
|
|
2
2
|
.rt-TextFieldSlot[data-side='right'],
|
|
3
3
|
.rt-TextFieldSlot:not([data-side='right']) ~ .rt-TextFieldSlot:not([data-side='left'])
|
|
4
|
-
`)?
|
|
4
|
+
`)?p.value.length:0;requestAnimationFrame(()=>{try{p.setSelectionRange(x,x)}catch{}p.focus()})}},l.createElement("input",{spellCheck:"false",...h,ref:(0,F.composeRefs)(o,e),className:"rt-reset rt-TextFieldInput"}),s)});u.displayName="TextField.Root";const c=l.forwardRef((t,e)=>{const{className:o,color:s,side:r,...a}=(0,m.extractProps)(t,n.textFieldSlotPropDefs);return l.createElement("div",{"data-accent-color":s,"data-side":r,...a,ref:e,className:(0,d.default)("rt-TextFieldSlot",o)})});c.displayName="TextField.Slot";
|
|
5
5
|
//# sourceMappingURL=text-field.js.map
|