rivet-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/chunk-fjtwj9cw.js +79 -0
- package/dist/chunk-fjtwj9cw.js.map +10 -0
- package/dist/components/Accordion/Accordion.d.ts +7 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +10 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +62 -0
- package/dist/components/Accordion/index.js.map +10 -0
- package/dist/components/Alert/Alert.d.ts +15 -0
- package/dist/components/Alert/Alert.stories.d.ts +23 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/index.js +57 -0
- package/dist/components/Alert/index.js.map +10 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts +11 -0
- package/dist/components/AlertDialog/AlertDialog.stories.d.ts +9 -0
- package/dist/components/AlertDialog/index.d.ts +1 -0
- package/dist/components/AlertDialog/index.js +66 -0
- package/dist/components/AlertDialog/index.js.map +10 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +17 -0
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +6 -0
- package/dist/components/Autocomplete/index.d.ts +1 -0
- package/dist/components/Autocomplete/index.js +109 -0
- package/dist/components/Autocomplete/index.js.map +10 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +29 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.js +65 -0
- package/dist/components/Avatar/index.js.map +10 -0
- package/dist/components/AvatarLabel/AvatarLabel.d.ts +12 -0
- package/dist/components/AvatarLabel/AvatarLabel.stories.d.ts +10 -0
- package/dist/components/AvatarLabel/index.d.ts +2 -0
- package/dist/components/AvatarLabel/index.js +74 -0
- package/dist/components/AvatarLabel/index.js.map +10 -0
- package/dist/components/Badge/Badge.d.ts +13 -0
- package/dist/components/Badge/Badge.stories.d.ts +25 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +38 -0
- package/dist/components/Badge/index.js.map +10 -0
- package/dist/components/Button/Button.d.ts +15 -0
- package/dist/components/Button/Button.stories.d.ts +35 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.js +44 -0
- package/dist/components/Button/index.js.map +10 -0
- package/dist/components/Card/Card.d.ts +6 -0
- package/dist/components/Card/Card.stories.d.ts +13 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +47 -0
- package/dist/components/Card/index.js.map +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +25 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +68 -0
- package/dist/components/Checkbox/index.js.map +10 -0
- package/dist/components/Collapsible/Collapsible.d.ts +4 -0
- package/dist/components/Collapsible/Collapsible.stories.d.ts +10 -0
- package/dist/components/Collapsible/index.d.ts +1 -0
- package/dist/components/Collapsible/index.js +34 -0
- package/dist/components/Collapsible/index.js.map +10 -0
- package/dist/components/Combobox/Combobox.d.ts +24 -0
- package/dist/components/Combobox/Combobox.stories.d.ts +13 -0
- package/dist/components/Combobox/index.d.ts +1 -0
- package/dist/components/Combobox/index.js +162 -0
- package/dist/components/Combobox/index.js.map +10 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +22 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +10 -0
- package/dist/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/index.js +85 -0
- package/dist/components/ConfirmDialog/index.js.map +10 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +21 -0
- package/dist/components/ContextMenu/ContextMenu.stories.d.ts +7 -0
- package/dist/components/ContextMenu/index.d.ts +1 -0
- package/dist/components/ContextMenu/index.js +117 -0
- package/dist/components/ContextMenu/index.js.map +10 -0
- package/dist/components/Dialog/Dialog.d.ts +11 -0
- package/dist/components/Dialog/Dialog.stories.d.ts +10 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +66 -0
- package/dist/components/Dialog/index.js.map +10 -0
- package/dist/components/Drawer/Drawer.d.ts +13 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +9 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +81 -0
- package/dist/components/Drawer/index.js.map +10 -0
- package/dist/components/Field/Field.d.ts +8 -0
- package/dist/components/Field/Field.stories.d.ts +21 -0
- package/dist/components/Field/index.d.ts +1 -0
- package/dist/components/Field/index.js +52 -0
- package/dist/components/Field/index.js.map +10 -0
- package/dist/components/Fieldset/Fieldset.d.ts +3 -0
- package/dist/components/Fieldset/Fieldset.stories.d.ts +14 -0
- package/dist/components/Fieldset/index.d.ts +1 -0
- package/dist/components/Fieldset/index.js +27 -0
- package/dist/components/Fieldset/index.js.map +10 -0
- package/dist/components/Form/Form.d.ts +5 -0
- package/dist/components/Form/Form.stories.d.ts +5 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/index.js +20 -0
- package/dist/components/Form/index.js.map +10 -0
- package/dist/components/Input/Input.d.ts +16 -0
- package/dist/components/Input/Input.stories.d.ts +34 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.js +44 -0
- package/dist/components/Input/index.js.map +10 -0
- package/dist/components/Menu/Menu.d.ts +21 -0
- package/dist/components/Menu/Menu.stories.d.ts +9 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.js +117 -0
- package/dist/components/Menu/index.js.map +10 -0
- package/dist/components/Menubar/Menubar.d.ts +2 -0
- package/dist/components/Menubar/Menubar.stories.d.ts +5 -0
- package/dist/components/Menubar/index.d.ts +1 -0
- package/dist/components/Menubar/index.js +20 -0
- package/dist/components/Menubar/index.js.map +10 -0
- package/dist/components/Meter/Meter.d.ts +6 -0
- package/dist/components/Meter/Meter.stories.d.ts +7 -0
- package/dist/components/Meter/index.d.ts +1 -0
- package/dist/components/Meter/index.js +48 -0
- package/dist/components/Meter/index.js.map +10 -0
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +12 -0
- package/dist/components/NavigationMenu/NavigationMenu.stories.d.ts +5 -0
- package/dist/components/NavigationMenu/index.d.ts +1 -0
- package/dist/components/NavigationMenu/index.js +100 -0
- package/dist/components/NavigationMenu/index.js.map +10 -0
- package/dist/components/NumberField/NumberField.d.ts +8 -0
- package/dist/components/NumberField/NumberField.stories.d.ts +7 -0
- package/dist/components/NumberField/index.d.ts +1 -0
- package/dist/components/NumberField/index.js +84 -0
- package/dist/components/NumberField/index.js.map +10 -0
- package/dist/components/PageHeader/PageHeader.d.ts +10 -0
- package/dist/components/PageHeader/PageHeader.stories.d.ts +10 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PageHeader/index.js +48 -0
- package/dist/components/PageHeader/index.js.map +10 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/Popover.stories.d.ts +9 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +74 -0
- package/dist/components/Popover/index.js.map +10 -0
- package/dist/components/PreviewCard/PreviewCard.d.ts +9 -0
- package/dist/components/PreviewCard/PreviewCard.stories.d.ts +8 -0
- package/dist/components/PreviewCard/index.d.ts +1 -0
- package/dist/components/PreviewCard/index.js +53 -0
- package/dist/components/PreviewCard/index.js.map +10 -0
- package/dist/components/ProfileCard/ProfileCard.d.ts +19 -0
- package/dist/components/ProfileCard/ProfileCard.stories.d.ts +11 -0
- package/dist/components/ProfileCard/index.d.ts +2 -0
- package/dist/components/ProfileCard/index.js +97 -0
- package/dist/components/ProfileCard/index.js.map +10 -0
- package/dist/components/Progress/Progress.d.ts +6 -0
- package/dist/components/Progress/Progress.stories.d.ts +7 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.js +48 -0
- package/dist/components/Progress/index.js.map +10 -0
- package/dist/components/Radio/Radio.d.ts +6 -0
- package/dist/components/Radio/Radio.stories.d.ts +20 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/index.js +35 -0
- package/dist/components/Radio/index.js.map +10 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +7 -0
- package/dist/components/ScrollArea/ScrollArea.stories.d.ts +6 -0
- package/dist/components/ScrollArea/index.d.ts +1 -0
- package/dist/components/ScrollArea/index.js +55 -0
- package/dist/components/ScrollArea/index.js.map +10 -0
- package/dist/components/SearchField/SearchField.d.ts +11 -0
- package/dist/components/SearchField/SearchField.stories.d.ts +9 -0
- package/dist/components/SearchField/index.d.ts +2 -0
- package/dist/components/SearchField/index.js +65 -0
- package/dist/components/SearchField/index.js.map +10 -0
- package/dist/components/Select/Select.d.ts +19 -0
- package/dist/components/Select/Select.stories.d.ts +20 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +143 -0
- package/dist/components/Select/index.js.map +10 -0
- package/dist/components/Separator/Separator.d.ts +2 -0
- package/dist/components/Separator/Separator.stories.d.ts +10 -0
- package/dist/components/Separator/index.d.ts +1 -0
- package/dist/components/Separator/index.js +20 -0
- package/dist/components/Separator/index.js.map +10 -0
- package/dist/components/Slider/Slider.d.ts +10 -0
- package/dist/components/Slider/Slider.stories.d.ts +7 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +55 -0
- package/dist/components/Slider/index.js.map +10 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.stories.d.ts +24 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +27 -0
- package/dist/components/Switch/index.js.map +10 -0
- package/dist/components/Tabs/Tabs.d.ts +6 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +9 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +43 -0
- package/dist/components/Tabs/index.js.map +10 -0
- package/dist/components/Toast/Toast.d.ts +14 -0
- package/dist/components/Toast/Toast.stories.d.ts +8 -0
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/components/Toast/index.js +127 -0
- package/dist/components/Toast/index.js.map +10 -0
- package/dist/components/Toggle/Toggle.d.ts +3 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +8 -0
- package/dist/components/Toggle/index.d.ts +1 -0
- package/dist/components/Toggle/index.js +20 -0
- package/dist/components/Toggle/index.js.map +10 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +3 -0
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +6 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/ToggleGroup/index.js +20 -0
- package/dist/components/ToggleGroup/index.js.map +10 -0
- package/dist/components/Toolbar/Toolbar.d.ts +7 -0
- package/dist/components/Toolbar/Toolbar.stories.d.ts +7 -0
- package/dist/components/Toolbar/index.d.ts +1 -0
- package/dist/components/Toolbar/index.js +50 -0
- package/dist/components/Toolbar/index.js.map +10 -0
- package/dist/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +9 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +48 -0
- package/dist/components/Tooltip/index.js.map +10 -0
- package/dist/fonts.css +3 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +620 -0
- package/dist/index.js.map +9 -0
- package/dist/stories/Camps.stories.d.ts +11 -0
- package/dist/stories/Plains.stories.d.ts +11 -0
- package/dist/stories/Theming.stories.d.ts +8 -0
- package/dist/stories/Typography.stories.d.ts +5 -0
- package/dist/styles.css +2 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +1806 -0
- package/dist/utils/cn.js.map +12 -0
- package/dist/utils/cn.test.d.ts +1 -0
- package/package.json +266 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/NavigationMenu/NavigationMenu.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import * as React from 'react';\nimport { NavigationMenu } from '@base-ui/react/navigation-menu';\nimport { cn } from '../../utils/cn';\n\nexport const NavigationMenuPortal = NavigationMenu.Portal;\n\nexport const NavigationMenuRoot = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Root>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Root\n ref={ref}\n className={cn('relative flex items-center', className)}\n {...props}\n />\n));\nNavigationMenuRoot.displayName = 'NavigationMenuRoot';\n\nexport const NavigationMenuList = React.forwardRef<\n HTMLUListElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.List\n ref={ref}\n className={cn(\n 'flex flex-1 list-none items-center justify-center gap-1',\n className\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = 'NavigationMenuList';\n\nexport const NavigationMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Item>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Item\n ref={ref}\n className={cn('relative', className)}\n {...props}\n />\n));\nNavigationMenuItem.displayName = 'NavigationMenuItem';\n\nexport const NavigationMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Trigger>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Trigger\n ref={ref}\n className={cn(\n 'group inline-flex h-9 items-center justify-center gap-1 rounded-lg bg-transparent px-3 py-2 text-sm font-medium text-kraft transition-colors hover:bg-canvas/40 hover:text-kraft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon data-popup-open:bg-canvas/40',\n className\n )}\n {...props}\n />\n));\nNavigationMenuTrigger.displayName = 'NavigationMenuTrigger';\n\nexport const NavigationMenuIcon = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Icon>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenu.Icon\n ref={ref}\n className={cn(\n 'relative top-px ml-0.5 transition-transform duration-200 group-data-popup-open:rotate-180',\n className\n )}\n {...props}\n >\n {children ?? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n )}\n </NavigationMenu.Icon>\n));\nNavigationMenuIcon.displayName = 'NavigationMenuIcon';\n\nexport const NavigationMenuPositioner = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Positioner>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Positioner\n ref={ref}\n className={cn('absolute top-full left-0 z-50', className)}\n {...props}\n />\n));\nNavigationMenuPositioner.displayName = 'NavigationMenuPositioner';\n\nexport const NavigationMenuViewport = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Viewport>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Viewport\n ref={ref}\n className={cn(\n 'mt-1 overflow-hidden rounded-xl border border-kraft/15 bg-surface shadow-lg shadow-kraft/10',\n 'transition-[width,height] duration-200 origin-top-left',\n className\n )}\n {...props}\n />\n));\nNavigationMenuViewport.displayName = 'NavigationMenuViewport';\n\nexport const NavigationMenuPopup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Popup>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Popup\n ref={ref}\n className={cn('p-1', className)}\n {...props}\n />\n));\nNavigationMenuPopup.displayName = 'NavigationMenuPopup';\n\nexport const NavigationMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Content\n ref={ref}\n className={cn('p-3', className)}\n {...props}\n />\n));\nNavigationMenuContent.displayName = 'NavigationMenuContent';\n\nexport const NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<typeof NavigationMenu.Link>\n>(({ className, ...props }, ref) => (\n <NavigationMenu.Link\n ref={ref}\n className={cn(\n 'block select-none rounded-lg px-3 py-2 text-sm text-kraft leading-snug no-underline outline-none transition-colors hover:bg-canvas/40 focus-visible:bg-canvas/40',\n className\n )}\n {...props}\n />\n));\nNavigationMenuLink.displayName = 'NavigationMenuLink';\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AAAA;AACA;;AAGO,IAAM,uBAAuB,eAAe;AAE5C,IAAM,qBAA2B,iBAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,MAAhB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,8BAA8B,SAAS;AAAA,KACjD;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;AAE1B,IAAM,qBAA2B,iBAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,MAAhB;AAAA,EACI;AAAA,EACA,WAAW,GACP,2DACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;AAE1B,IAAM,qBAA2B,iBAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,MAAhB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,YAAY,SAAS;AAAA,KAC/B;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;AAE1B,IAAM,wBAA8B,iBAGzC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,SAAhB;AAAA,EACI;AAAA,EACA,WAAW,GACP,2RACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,sBAAsB,cAAc;AAE7B,IAAM,qBAA2B,iBAGtC,GAAG,WAAW,aAAa,SAAS,wBAClC,IAwBE,eAAe,MAxBjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,6FACA,SACJ;AAAA,KACI;AAAA,EANR,UAQK,4BACG,IAaE,OAbF;AAAA,IACI,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,eAAW;AAAA,IAVf,0BAYI,IAAC,YAAD;AAAA,MAAU,QAAO;AAAA,KAAiB;AAAA,GACpC;AAAA,CAER,CACL;AACD,mBAAmB,cAAc;AAE1B,IAAM,2BAAiC,iBAG5C,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,YAAhB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,KACpD;AAAA,CACR,CACH;AACD,yBAAyB,cAAc;AAEhC,IAAM,yBAA+B,iBAG1C,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,UAAhB;AAAA,EACI;AAAA,EACA,WAAW,GACP,+FACA,0DACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,uBAAuB,cAAc;AAE9B,IAAM,sBAA4B,iBAGvC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,OAAhB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,OAAO,SAAS;AAAA,KAC1B;AAAA,CACR,CACH;AACD,oBAAoB,cAAc;AAE3B,IAAM,wBAA8B,iBAGzC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,SAAhB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,OAAO,SAAS;AAAA,KAC1B;AAAA,CACR,CACH;AACD,sBAAsB,cAAc;AAE7B,IAAM,qBAA2B,iBAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,eAAe,MAAhB;AAAA,EACI;AAAA,EACA,WAAW,GACP,oKACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;",
|
|
8
|
+
"debugId": "A43D4C7F728B250464756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const NumberFieldRoot: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const NumberFieldGroup: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const NumberFieldDecrement: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldDecrementProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const NumberFieldIncrement: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldIncrementProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const NumberFieldInput: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldInputProps, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
7
|
+
export declare const NumberFieldScrubArea: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldScrubAreaProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export declare const NumberFieldScrubAreaCursor: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").NumberFieldScrubAreaCursorProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NumberFieldRoot, NumberFieldGroup, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldScrubArea, NumberFieldScrubAreaCursor } from './NumberField';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// src/components/NumberField/NumberField.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var NumberFieldRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.Root, {
|
|
10
|
+
ref,
|
|
11
|
+
className: cn("flex flex-col gap-1", className),
|
|
12
|
+
...props
|
|
13
|
+
}));
|
|
14
|
+
NumberFieldRoot.displayName = "NumberFieldRoot";
|
|
15
|
+
var NumberFieldGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.Group, {
|
|
16
|
+
ref,
|
|
17
|
+
className: cn("flex h-10 items-center overflow-hidden rounded-lg border border-kraft/25 bg-surface focus-within:ring-2 focus-within:ring-ribbon focus-within:ring-offset-2", className),
|
|
18
|
+
...props
|
|
19
|
+
}));
|
|
20
|
+
NumberFieldGroup.displayName = "NumberFieldGroup";
|
|
21
|
+
var NumberFieldDecrement = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
22
|
+
ref,
|
|
23
|
+
className: cn("flex h-full w-9 shrink-0 items-center justify-center border-r border-kraft/15 text-kraft/60 transition-colors hover:bg-canvas/40 hover:text-kraft focus-visible:outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
|
|
24
|
+
...props,
|
|
25
|
+
children: children ?? /* @__PURE__ */ jsx("svg", {
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
fill: "none",
|
|
28
|
+
stroke: "currentColor",
|
|
29
|
+
strokeWidth: 2,
|
|
30
|
+
className: "h-3.5 w-3.5",
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
33
|
+
d: "M5 12h14"
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
}));
|
|
37
|
+
NumberFieldDecrement.displayName = "NumberFieldDecrement";
|
|
38
|
+
var NumberFieldIncrement = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.Increment, {
|
|
39
|
+
ref,
|
|
40
|
+
className: cn("flex h-full w-9 shrink-0 items-center justify-center border-l border-kraft/15 text-kraft/60 transition-colors hover:bg-canvas/40 hover:text-kraft focus-visible:outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
|
|
41
|
+
...props,
|
|
42
|
+
children: children ?? /* @__PURE__ */ jsx("svg", {
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: 2,
|
|
47
|
+
className: "h-3.5 w-3.5",
|
|
48
|
+
"aria-hidden": true,
|
|
49
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
50
|
+
d: "M12 5v14M5 12h14"
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}));
|
|
54
|
+
NumberFieldIncrement.displayName = "NumberFieldIncrement";
|
|
55
|
+
var NumberFieldInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.Input, {
|
|
56
|
+
ref,
|
|
57
|
+
className: cn("h-full min-w-0 flex-1 bg-transparent px-3 text-center text-sm text-kraft focus-visible:outline-none", className),
|
|
58
|
+
...props
|
|
59
|
+
}));
|
|
60
|
+
NumberFieldInput.displayName = "NumberFieldInput";
|
|
61
|
+
var NumberFieldScrubArea = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.ScrubArea, {
|
|
62
|
+
ref,
|
|
63
|
+
className: cn("cursor-ew-resize select-none", className),
|
|
64
|
+
...props
|
|
65
|
+
}));
|
|
66
|
+
NumberFieldScrubArea.displayName = "NumberFieldScrubArea";
|
|
67
|
+
var NumberFieldScrubAreaCursor = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NumberField.ScrubAreaCursor, {
|
|
68
|
+
ref,
|
|
69
|
+
className: cn("drop-shadow", className),
|
|
70
|
+
...props
|
|
71
|
+
}));
|
|
72
|
+
NumberFieldScrubAreaCursor.displayName = "NumberFieldScrubAreaCursor";
|
|
73
|
+
export {
|
|
74
|
+
NumberFieldScrubAreaCursor,
|
|
75
|
+
NumberFieldScrubArea,
|
|
76
|
+
NumberFieldRoot,
|
|
77
|
+
NumberFieldInput,
|
|
78
|
+
NumberFieldIncrement,
|
|
79
|
+
NumberFieldGroup,
|
|
80
|
+
NumberFieldDecrement
|
|
81
|
+
};
|
|
82
|
+
export { NumberFieldRoot, NumberFieldGroup, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldScrubArea, NumberFieldScrubAreaCursor };
|
|
83
|
+
|
|
84
|
+
//# debugId=E92C99C58DD01F0C64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/NumberField/NumberField.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import * as React from 'react';\nimport { NumberField } from '@base-ui/react/number-field';\nimport { cn } from '../../utils/cn';\n\nexport const NumberFieldRoot = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof NumberField.Root>\n>(({ className, ...props }, ref) => (\n <NumberField.Root\n ref={ref}\n className={cn('flex flex-col gap-1', className)}\n {...props}\n />\n));\nNumberFieldRoot.displayName = 'NumberFieldRoot';\n\nexport const NumberFieldGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof NumberField.Group>\n>(({ className, ...props }, ref) => (\n <NumberField.Group\n ref={ref}\n className={cn(\n 'flex h-10 items-center overflow-hidden rounded-lg border border-kraft/25 bg-surface focus-within:ring-2 focus-within:ring-ribbon focus-within:ring-offset-2',\n className\n )}\n {...props}\n />\n));\nNumberFieldGroup.displayName = 'NumberFieldGroup';\n\nexport const NumberFieldDecrement = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof NumberField.Decrement>\n>(({ className, children, ...props }, ref) => (\n <NumberField.Decrement\n ref={ref}\n className={cn(\n 'flex h-full w-9 shrink-0 items-center justify-center border-r border-kraft/15 text-kraft/60 transition-colors hover:bg-canvas/40 hover:text-kraft focus-visible:outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50',\n className\n )}\n {...props}\n >\n {children ?? (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n className=\"h-3.5 w-3.5\"\n aria-hidden\n >\n <path d=\"M5 12h14\" />\n </svg>\n )}\n </NumberField.Decrement>\n));\nNumberFieldDecrement.displayName = 'NumberFieldDecrement';\n\nexport const NumberFieldIncrement = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof NumberField.Increment>\n>(({ className, children, ...props }, ref) => (\n <NumberField.Increment\n ref={ref}\n className={cn(\n 'flex h-full w-9 shrink-0 items-center justify-center border-l border-kraft/15 text-kraft/60 transition-colors hover:bg-canvas/40 hover:text-kraft focus-visible:outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50',\n className\n )}\n {...props}\n >\n {children ?? (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n className=\"h-3.5 w-3.5\"\n aria-hidden\n >\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n )}\n </NumberField.Increment>\n));\nNumberFieldIncrement.displayName = 'NumberFieldIncrement';\n\nexport const NumberFieldInput = React.forwardRef<\n HTMLInputElement,\n React.ComponentPropsWithoutRef<typeof NumberField.Input>\n>(({ className, ...props }, ref) => (\n <NumberField.Input\n ref={ref}\n className={cn(\n 'h-full min-w-0 flex-1 bg-transparent px-3 text-center text-sm text-kraft focus-visible:outline-none',\n className\n )}\n {...props}\n />\n));\nNumberFieldInput.displayName = 'NumberFieldInput';\n\nexport const NumberFieldScrubArea = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<typeof NumberField.ScrubArea>\n>(({ className, ...props }, ref) => (\n <NumberField.ScrubArea\n ref={ref}\n className={cn('cursor-ew-resize select-none', className)}\n {...props}\n />\n));\nNumberFieldScrubArea.displayName = 'NumberFieldScrubArea';\n\nexport const NumberFieldScrubAreaCursor = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<typeof NumberField.ScrubAreaCursor>\n>(({ className, ...props }, ref) => (\n <NumberField.ScrubAreaCursor\n ref={ref}\n className={cn('drop-shadow', className)}\n {...props}\n />\n));\nNumberFieldScrubAreaCursor.displayName = 'NumberFieldScrubAreaCursor';\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AAAA;AACA;;AAGO,IAAM,kBAAwB,iBAGnC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,MAAb;AAAA,EACI;AAAA,EACA,WAAW,GAAG,uBAAuB,SAAS;AAAA,KAC1C;AAAA,CACR,CACH;AACD,gBAAgB,cAAc;AAEvB,IAAM,mBAAyB,iBAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,OAAb;AAAA,EACI;AAAA,EACA,WAAW,GACP,+JACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;AAExB,IAAM,uBAA6B,iBAGxC,GAAG,WAAW,aAAa,SAAS,wBAClC,IAoBE,YAAY,WApBd;AAAA,EACI;AAAA,EACA,WAAW,GACP,0OACA,SACJ;AAAA,KACI;AAAA,EANR,UAQK,4BACG,IASE,OATF;AAAA,IACI,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAa;AAAA,IACb,WAAU;AAAA,IACV,eAAW;AAAA,IANf,0BAQI,IAAC,QAAD;AAAA,MAAM,GAAE;AAAA,KAAW;AAAA,GACrB;AAAA,CAER,CACL;AACD,qBAAqB,cAAc;AAE5B,IAAM,uBAA6B,iBAGxC,GAAG,WAAW,aAAa,SAAS,wBAClC,IAoBE,YAAY,WApBd;AAAA,EACI;AAAA,EACA,WAAW,GACP,0OACA,SACJ;AAAA,KACI;AAAA,EANR,UAQK,4BACG,IASE,OATF;AAAA,IACI,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAa;AAAA,IACb,WAAU;AAAA,IACV,eAAW;AAAA,IANf,0BAQI,IAAC,QAAD;AAAA,MAAM,GAAE;AAAA,KAAmB;AAAA,GAC7B;AAAA,CAER,CACL;AACD,qBAAqB,cAAc;AAE5B,IAAM,mBAAyB,iBAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,OAAb;AAAA,EACI;AAAA,EACA,WAAW,GACP,uGACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;AAExB,IAAM,uBAA6B,iBAGxC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,WAAb;AAAA,EACI;AAAA,EACA,WAAW,GAAG,gCAAgC,SAAS;AAAA,KACnD;AAAA,CACR,CACH;AACD,qBAAqB,cAAc;AAE5B,IAAM,6BAAmC,iBAG9C,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,iBAAb;AAAA,EACI;AAAA,EACA,WAAW,GAAG,eAAe,SAAS;AAAA,KAClC;AAAA,CACR,CACH;AACD,2BAA2B,cAAc;",
|
|
8
|
+
"debugId": "E92C99C58DD01F0C64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PageHeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
/** Buttons, links, or any controls rendered flush-right */
|
|
6
|
+
actions?: React.ReactNode;
|
|
7
|
+
/** Optional slot above the title — useful for breadcrumbs */
|
|
8
|
+
eyebrow?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function PageHeader({ title, subtitle, actions, eyebrow, className, ...props }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PageHeader } from './PageHeader';
|
|
3
|
+
declare const meta: Meta<typeof PageHeader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PageHeader>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithSubtitle: Story;
|
|
8
|
+
export declare const WithActions: Story;
|
|
9
|
+
export declare const WithEyebrow: Story;
|
|
10
|
+
export declare const WithBadge: Story;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// src/components/PageHeader/PageHeader.tsx
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function PageHeader({
|
|
8
|
+
title,
|
|
9
|
+
subtitle,
|
|
10
|
+
actions,
|
|
11
|
+
eyebrow,
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
16
|
+
className: cn("flex flex-col gap-4 border-b border-kraft/10 pb-6 sm:flex-row sm:items-start sm:justify-between", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "min-w-0 space-y-1",
|
|
21
|
+
children: [
|
|
22
|
+
eyebrow && /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: "text-xs font-medium uppercase tracking-widest text-kraft/50",
|
|
24
|
+
children: eyebrow
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx("h1", {
|
|
27
|
+
className: "truncate text-2xl font-bold text-kraft",
|
|
28
|
+
children: title
|
|
29
|
+
}),
|
|
30
|
+
subtitle && /* @__PURE__ */ jsx("p", {
|
|
31
|
+
className: "text-sm text-kraft/60",
|
|
32
|
+
children: subtitle
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
actions && /* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: "flex shrink-0 items-center gap-2",
|
|
38
|
+
children: actions
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
PageHeader
|
|
45
|
+
};
|
|
46
|
+
export { PageHeader };
|
|
47
|
+
|
|
48
|
+
//# debugId=F03E1FFDC131D45C64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/PageHeader/PageHeader.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface PageHeaderProps extends React.HTMLAttributes<HTMLElement> {\n title: string;\n subtitle?: string;\n /** Buttons, links, or any controls rendered flush-right */\n actions?: React.ReactNode;\n /** Optional slot above the title — useful for breadcrumbs */\n eyebrow?: React.ReactNode;\n}\n\nexport function PageHeader({\n title,\n subtitle,\n actions,\n eyebrow,\n className,\n ...props\n}: PageHeaderProps) {\n return (\n <header\n className={cn(\n 'flex flex-col gap-4 border-b border-kraft/10 pb-6 sm:flex-row sm:items-start sm:justify-between',\n className\n )}\n {...props}\n >\n <div className=\"min-w-0 space-y-1\">\n {eyebrow && (\n <div className=\"text-xs font-medium uppercase tracking-widest text-kraft/50\">\n {eyebrow}\n </div>\n )}\n <h1 className=\"truncate text-2xl font-bold text-kraft\">\n {title}\n </h1>\n {subtitle && (\n <p className=\"text-sm text-kraft/60\">{subtitle}</p>\n )}\n </div>\n {actions && (\n <div className=\"flex shrink-0 items-center gap-2\">\n {actions}\n </div>\n )}\n </header>\n );\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;AAYO,SAAS,UAAU;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,GACa;AAAA,EAChB,uBACI,KAyBE,UAzBF;AAAA,IACI,WAAW,GACP,mGACA,SACJ;AAAA,OACI;AAAA,IALR,UAyBE;AAAA,sBAlBE,KAYE,OAZF;AAAA,QAAK,WAAU;AAAA,QAAf,UAYE;AAAA,UAXG,2BACG,IAEE,OAFF;AAAA,YAAK,WAAU;AAAA,YAAf,UACK;AAAA,WACH;AAAA,0BAEN,IAEE,MAFF;AAAA,YAAI,WAAU;AAAA,YAAd,UACK;AAAA,WACH;AAAA,UACD,4BACG,IAAiD,KAAjD;AAAA,YAAG,WAAU;AAAA,YAAb,UAAsC;AAAA,WAAW;AAAA;AAAA,OAEvD;AAAA,MACD,2BACG,IAEE,OAFF;AAAA,QAAK,WAAU;AAAA,QAAf,UACK;AAAA,OACH;AAAA;AAAA,GAER;AAAA;",
|
|
8
|
+
"debugId": "F03E1FFDC131D45C64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const PopoverRoot: typeof BasePopover.Root;
|
|
4
|
+
export declare const PopoverPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const PopoverTrigger: React.ForwardRefExoticComponent<React.ComponentPropsWithoutRef<typeof BasePopover.Trigger> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const PopoverBackdrop: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const PopoverPositioner: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const PopoverPopup: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const PopoverTitle: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
export declare const PopoverDescription: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
export declare const PopoverClose: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export declare const PopoverArrow: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Default: StoryObj;
|
|
8
|
+
export declare const RichContent: StoryObj;
|
|
9
|
+
export declare const OpenOnHover: StoryObj;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PopoverRoot, PopoverPortal, PopoverTrigger, PopoverBackdrop, PopoverPositioner, PopoverPopup, PopoverTitle, PopoverDescription, PopoverClose, PopoverArrow } from './Popover';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Popover/Popover.tsx
|
|
6
|
+
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var PopoverRoot = BasePopover.Root;
|
|
10
|
+
var PopoverPortal = BasePopover.Portal;
|
|
11
|
+
var PopoverTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Trigger, {
|
|
12
|
+
ref,
|
|
13
|
+
className: cn("inline-flex h-9 items-center justify-center rounded-lg border border-kraft/25 bg-surface px-4 text-sm font-medium text-kraft transition-colors select-none hover:bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-offset-2 data-popup-open:bg-canvas", className),
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
|
17
|
+
var PopoverBackdrop = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Backdrop, {
|
|
18
|
+
ref,
|
|
19
|
+
className: cn("fixed inset-0", className),
|
|
20
|
+
...props
|
|
21
|
+
}));
|
|
22
|
+
PopoverBackdrop.displayName = "PopoverBackdrop";
|
|
23
|
+
var PopoverPositioner = React.forwardRef(({ className, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Positioner, {
|
|
24
|
+
ref,
|
|
25
|
+
sideOffset,
|
|
26
|
+
className: cn("z-50", className),
|
|
27
|
+
...props
|
|
28
|
+
}));
|
|
29
|
+
PopoverPositioner.displayName = "PopoverPositioner";
|
|
30
|
+
var PopoverPopup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Popup, {
|
|
31
|
+
ref,
|
|
32
|
+
className: cn("origin-[var(--transform-origin)] rounded-lg border border-kraft/15 bg-surface p-4 text-kraft shadow-lg transition-[transform,opacity] duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-instant:transition-none data-starting-style:scale-95 data-starting-style:opacity-0", className),
|
|
33
|
+
...props
|
|
34
|
+
}));
|
|
35
|
+
PopoverPopup.displayName = "PopoverPopup";
|
|
36
|
+
var PopoverTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Title, {
|
|
37
|
+
ref,
|
|
38
|
+
className: cn("mb-1 text-base font-semibold text-kraft", className),
|
|
39
|
+
...props
|
|
40
|
+
}));
|
|
41
|
+
PopoverTitle.displayName = "PopoverTitle";
|
|
42
|
+
var PopoverDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Description, {
|
|
43
|
+
ref,
|
|
44
|
+
className: cn("text-sm text-kraft/60", className),
|
|
45
|
+
...props
|
|
46
|
+
}));
|
|
47
|
+
PopoverDescription.displayName = "PopoverDescription";
|
|
48
|
+
var PopoverClose = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Close, {
|
|
49
|
+
ref,
|
|
50
|
+
className: cn("inline-flex h-9 items-center justify-center rounded-lg border border-kraft/25 bg-surface px-4 text-sm font-medium text-kraft transition-colors select-none hover:bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-offset-2", className),
|
|
51
|
+
...props
|
|
52
|
+
}));
|
|
53
|
+
PopoverClose.displayName = "PopoverClose";
|
|
54
|
+
var PopoverArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePopover.Arrow, {
|
|
55
|
+
ref,
|
|
56
|
+
className: cn("flex data-[side=bottom]:top-[-8px] data-[side=bottom]:rotate-0 data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180", className),
|
|
57
|
+
...props
|
|
58
|
+
}));
|
|
59
|
+
PopoverArrow.displayName = "PopoverArrow";
|
|
60
|
+
export {
|
|
61
|
+
PopoverTrigger,
|
|
62
|
+
PopoverTitle,
|
|
63
|
+
PopoverRoot,
|
|
64
|
+
PopoverPositioner,
|
|
65
|
+
PopoverPortal,
|
|
66
|
+
PopoverPopup,
|
|
67
|
+
PopoverDescription,
|
|
68
|
+
PopoverClose,
|
|
69
|
+
PopoverBackdrop,
|
|
70
|
+
PopoverArrow
|
|
71
|
+
};
|
|
72
|
+
export { PopoverRoot, PopoverPortal, PopoverTrigger, PopoverBackdrop, PopoverPositioner, PopoverPopup, PopoverTitle, PopoverDescription, PopoverClose, PopoverArrow };
|
|
73
|
+
|
|
74
|
+
//# debugId=87FE80B3889D991864756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/Popover/Popover.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { Popover as BasePopover } from '@base-ui/react/popover';\nimport React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport const PopoverRoot = BasePopover.Root;\nexport const PopoverPortal = BasePopover.Portal;\n\nexport const PopoverTrigger: React.ForwardRefExoticComponent<\n React.ComponentPropsWithoutRef<typeof BasePopover.Trigger> &\n React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Trigger>\n>(({ className, ...props }, ref) => (\n <BasePopover.Trigger\n ref={ref}\n className={cn(\n 'inline-flex h-9 items-center justify-center rounded-lg border border-kraft/25 bg-surface px-4 text-sm font-medium text-kraft transition-colors select-none hover:bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-offset-2 data-popup-open:bg-canvas',\n className\n )}\n {...props}\n />\n));\nPopoverTrigger.displayName = 'PopoverTrigger';\n\nexport const PopoverBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Backdrop>\n>(({ className, ...props }, ref) => (\n <BasePopover.Backdrop\n ref={ref}\n className={cn('fixed inset-0', className)}\n {...props}\n />\n));\nPopoverBackdrop.displayName = 'PopoverBackdrop';\n\nexport const PopoverPositioner = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Positioner>\n>(({ className, sideOffset = 8, ...props }, ref) => (\n <BasePopover.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn('z-50', className)}\n {...props}\n />\n));\nPopoverPositioner.displayName = 'PopoverPositioner';\n\nexport const PopoverPopup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Popup>\n>(({ className, ...props }, ref) => (\n <BasePopover.Popup\n ref={ref}\n className={cn(\n 'origin-[var(--transform-origin)] rounded-lg border border-kraft/15 bg-surface p-4 text-kraft shadow-lg transition-[transform,opacity] duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-instant:transition-none data-starting-style:scale-95 data-starting-style:opacity-0',\n className\n )}\n {...props}\n />\n));\nPopoverPopup.displayName = 'PopoverPopup';\n\nexport const PopoverTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Title>\n>(({ className, ...props }, ref) => (\n <BasePopover.Title\n ref={ref}\n className={cn('mb-1 text-base font-semibold text-kraft', className)}\n {...props}\n />\n));\nPopoverTitle.displayName = 'PopoverTitle';\n\nexport const PopoverDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Description>\n>(({ className, ...props }, ref) => (\n <BasePopover.Description\n ref={ref}\n className={cn('text-sm text-kraft/60', className)}\n {...props}\n />\n));\nPopoverDescription.displayName = 'PopoverDescription';\n\nexport const PopoverClose = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Close>\n>(({ className, ...props }, ref) => (\n <BasePopover.Close\n ref={ref}\n className={cn(\n 'inline-flex h-9 items-center justify-center rounded-lg border border-kraft/25 bg-surface px-4 text-sm font-medium text-kraft transition-colors select-none hover:bg-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ribbon focus-visible:ring-offset-2',\n className\n )}\n {...props}\n />\n));\nPopoverClose.displayName = 'PopoverClose';\n\nexport const PopoverArrow = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePopover.Arrow>\n>(({ className, ...props }, ref) => (\n <BasePopover.Arrow\n ref={ref}\n className={cn(\n 'flex data-[side=bottom]:top-[-8px] data-[side=bottom]:rotate-0 data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180',\n className\n )}\n {...props}\n />\n));\nPopoverArrow.displayName = 'PopoverArrow';\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AAAA,oBAAS;AACT;;AAGO,IAAM,cAAc,YAAY;AAChC,IAAM,gBAAgB,YAAY;AAElC,IAAM,iBAGT,MAAM,WAGR,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,SAAb;AAAA,EACI;AAAA,EACA,WAAW,GACP,8SACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,eAAe,cAAc;AAEtB,IAAM,kBAAkB,MAAM,WAGnC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,UAAb;AAAA,EACI;AAAA,EACA,WAAW,GAAG,iBAAiB,SAAS;AAAA,KACpC;AAAA,CACR,CACH;AACD,gBAAgB,cAAc;AAEvB,IAAM,oBAAoB,MAAM,WAGrC,GAAG,WAAW,aAAa,MAAM,SAAS,wBACxC,IAAC,YAAY,YAAb;AAAA,EACI;AAAA,EACA;AAAA,EACA,WAAW,GAAG,QAAQ,SAAS;AAAA,KAC3B;AAAA,CACR,CACH;AACD,kBAAkB,cAAc;AAEzB,IAAM,eAAe,MAAM,WAGhC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,OAAb;AAAA,EACI;AAAA,EACA,WAAW,GACP,qSACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,aAAa,cAAc;AAEpB,IAAM,eAAe,MAAM,WAGhC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,OAAb;AAAA,EACI;AAAA,EACA,WAAW,GAAG,2CAA2C,SAAS;AAAA,KAC9D;AAAA,CACR,CACH;AACD,aAAa,cAAc;AAEpB,IAAM,qBAAqB,MAAM,WAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,aAAb;AAAA,EACI;AAAA,EACA,WAAW,GAAG,yBAAyB,SAAS;AAAA,KAC5C;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;AAE1B,IAAM,eAAe,MAAM,WAGhC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,OAAb;AAAA,EACI;AAAA,EACA,WAAW,GACP,oRACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,aAAa,cAAc;AAEpB,IAAM,eAAe,MAAM,WAGhC,GAAG,cAAc,SAAS,wBACxB,IAAC,YAAY,OAAb;AAAA,EACI;AAAA,EACA,WAAW,GACP,iPACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,aAAa,cAAc;",
|
|
8
|
+
"debugId": "87FE80B3889D991864756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const PreviewCardRoot: typeof BasePreviewCard.Root;
|
|
4
|
+
export declare const PreviewCardPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").PreviewCardPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const PreviewCardTrigger: React.ForwardRefExoticComponent<Omit<BasePreviewCard.Trigger.Props<unknown> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
6
|
+
export declare const PreviewCardBackdrop: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PreviewCardBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const PreviewCardPositioner: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PreviewCardPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const PreviewCardPopup: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PreviewCardPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const PreviewCardArrow: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PreviewCardArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PreviewCardRoot, PreviewCardPortal, PreviewCardTrigger, PreviewCardBackdrop, PreviewCardPositioner, PreviewCardPopup, PreviewCardArrow } from './PreviewCard';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../../utils/cn.js";
|
|
4
|
+
|
|
5
|
+
// src/components/PreviewCard/PreviewCard.tsx
|
|
6
|
+
import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var PreviewCardRoot = BasePreviewCard.Root;
|
|
10
|
+
var PreviewCardPortal = BasePreviewCard.Portal;
|
|
11
|
+
var PreviewCardTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePreviewCard.Trigger, {
|
|
12
|
+
ref,
|
|
13
|
+
className: cn("text-ribbon underline decoration-ribbon/60 decoration-1 underline-offset-2 outline-none hover:decoration-ribbon focus-visible:rounded-sm focus-visible:no-underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ribbon data-popup-open:decoration-ribbon", className),
|
|
14
|
+
...props
|
|
15
|
+
}));
|
|
16
|
+
PreviewCardTrigger.displayName = "PreviewCardTrigger";
|
|
17
|
+
var PreviewCardBackdrop = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePreviewCard.Backdrop, {
|
|
18
|
+
ref,
|
|
19
|
+
className: cn("fixed inset-0", className),
|
|
20
|
+
...props
|
|
21
|
+
}));
|
|
22
|
+
PreviewCardBackdrop.displayName = "PreviewCardBackdrop";
|
|
23
|
+
var PreviewCardPositioner = React.forwardRef(({ className, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx(BasePreviewCard.Positioner, {
|
|
24
|
+
ref,
|
|
25
|
+
sideOffset,
|
|
26
|
+
className: cn("z-50", className),
|
|
27
|
+
...props
|
|
28
|
+
}));
|
|
29
|
+
PreviewCardPositioner.displayName = "PreviewCardPositioner";
|
|
30
|
+
var PreviewCardPopup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePreviewCard.Popup, {
|
|
31
|
+
ref,
|
|
32
|
+
className: cn("origin-[var(--transform-origin)] rounded-lg border border-kraft/15 bg-surface text-kraft shadow-lg transition-[transform,opacity] duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0", className),
|
|
33
|
+
...props
|
|
34
|
+
}));
|
|
35
|
+
PreviewCardPopup.displayName = "PreviewCardPopup";
|
|
36
|
+
var PreviewCardArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(BasePreviewCard.Arrow, {
|
|
37
|
+
ref,
|
|
38
|
+
className: cn("flex data-[side=bottom]:top-[-8px] data-[side=bottom]:rotate-0 data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180", className),
|
|
39
|
+
...props
|
|
40
|
+
}));
|
|
41
|
+
PreviewCardArrow.displayName = "PreviewCardArrow";
|
|
42
|
+
export {
|
|
43
|
+
PreviewCardTrigger,
|
|
44
|
+
PreviewCardRoot,
|
|
45
|
+
PreviewCardPositioner,
|
|
46
|
+
PreviewCardPortal,
|
|
47
|
+
PreviewCardPopup,
|
|
48
|
+
PreviewCardBackdrop,
|
|
49
|
+
PreviewCardArrow
|
|
50
|
+
};
|
|
51
|
+
export { PreviewCardRoot, PreviewCardPortal, PreviewCardTrigger, PreviewCardBackdrop, PreviewCardPositioner, PreviewCardPopup, PreviewCardArrow };
|
|
52
|
+
|
|
53
|
+
//# debugId=C98052C5557596CB64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/PreviewCard/PreviewCard.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card';\nimport React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport const PreviewCardRoot = BasePreviewCard.Root;\nexport const PreviewCardPortal = BasePreviewCard.Portal;\n\n// PreviewCard.Trigger renders an <a> element — use HTMLAnchorElement\nexport const PreviewCardTrigger = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<typeof BasePreviewCard.Trigger>\n>(({ className, ...props }, ref) => (\n <BasePreviewCard.Trigger\n ref={ref}\n className={cn(\n 'text-ribbon underline decoration-ribbon/60 decoration-1 underline-offset-2 outline-none hover:decoration-ribbon focus-visible:rounded-sm focus-visible:no-underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ribbon data-popup-open:decoration-ribbon',\n className\n )}\n {...props}\n />\n));\nPreviewCardTrigger.displayName = 'PreviewCardTrigger';\n\nexport const PreviewCardBackdrop = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePreviewCard.Backdrop>\n>(({ className, ...props }, ref) => (\n <BasePreviewCard.Backdrop\n ref={ref}\n className={cn('fixed inset-0', className)}\n {...props}\n />\n));\nPreviewCardBackdrop.displayName = 'PreviewCardBackdrop';\n\nexport const PreviewCardPositioner = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePreviewCard.Positioner>\n>(({ className, sideOffset = 8, ...props }, ref) => (\n <BasePreviewCard.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn('z-50', className)}\n {...props}\n />\n));\nPreviewCardPositioner.displayName = 'PreviewCardPositioner';\n\nexport const PreviewCardPopup = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePreviewCard.Popup>\n>(({ className, ...props }, ref) => (\n <BasePreviewCard.Popup\n ref={ref}\n className={cn(\n 'origin-[var(--transform-origin)] rounded-lg border border-kraft/15 bg-surface text-kraft shadow-lg transition-[transform,opacity] duration-150 data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0',\n className\n )}\n {...props}\n />\n));\nPreviewCardPopup.displayName = 'PreviewCardPopup';\n\nexport const PreviewCardArrow = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof BasePreviewCard.Arrow>\n>(({ className, ...props }, ref) => (\n <BasePreviewCard.Arrow\n ref={ref}\n className={cn(\n 'flex data-[side=bottom]:top-[-8px] data-[side=bottom]:rotate-0 data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180',\n className\n )}\n {...props}\n />\n));\nPreviewCardArrow.displayName = 'PreviewCardArrow';\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;AAAA,wBAAS;AACT;;AAGO,IAAM,kBAAkB,gBAAgB;AACxC,IAAM,oBAAoB,gBAAgB;AAG1C,IAAM,qBAAqB,MAAM,WAGtC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,SAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,6RACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,mBAAmB,cAAc;AAE1B,IAAM,sBAAsB,MAAM,WAGvC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,UAAjB;AAAA,EACI;AAAA,EACA,WAAW,GAAG,iBAAiB,SAAS;AAAA,KACpC;AAAA,CACR,CACH;AACD,oBAAoB,cAAc;AAE3B,IAAM,wBAAwB,MAAM,WAGzC,GAAG,WAAW,aAAa,MAAM,SAAS,wBACxC,IAAC,gBAAgB,YAAjB;AAAA,EACI;AAAA,EACA;AAAA,EACA,WAAW,GAAG,QAAQ,SAAS;AAAA,KAC3B;AAAA,CACR,CACH;AACD,sBAAsB,cAAc;AAE7B,IAAM,mBAAmB,MAAM,WAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,OAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,oQACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;AAExB,IAAM,mBAAmB,MAAM,WAGpC,GAAG,cAAc,SAAS,wBACxB,IAAC,gBAAgB,OAAjB;AAAA,EACI;AAAA,EACA,WAAW,GACP,iPACA,SACJ;AAAA,KACI;AAAA,CACR,CACH;AACD,iBAAiB,cAAc;",
|
|
8
|
+
"debugId": "C98052C5557596CB64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type AvatarProps } from '../Avatar';
|
|
3
|
+
import { type BadgeProps } from '../Badge';
|
|
4
|
+
export interface ProfileCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Avatar image URL */
|
|
6
|
+
src?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
initials?: string;
|
|
9
|
+
avatarColor?: AvatarProps['color'];
|
|
10
|
+
name: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
/** Short bio or description shown below the role */
|
|
13
|
+
bio?: string;
|
|
14
|
+
badge?: string;
|
|
15
|
+
badgeVariant?: BadgeProps['variant'];
|
|
16
|
+
/** Action buttons or links rendered in the card footer */
|
|
17
|
+
actions?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function ProfileCard({ src, alt, initials, avatarColor, name, role, bio, badge, badgeVariant, actions, className, ...props }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ProfileCard } from './ProfileCard';
|
|
3
|
+
declare const meta: Meta<typeof ProfileCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ProfileCard>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithBadge: Story;
|
|
8
|
+
export declare const WithBio: Story;
|
|
9
|
+
export declare const WithActions: Story;
|
|
10
|
+
export declare const WithImage: Story;
|
|
11
|
+
export declare const Destructive: Story;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CardContent,
|
|
4
|
+
CardFooter,
|
|
5
|
+
CardHeader
|
|
6
|
+
} from "../Card/index.js";
|
|
7
|
+
import {
|
|
8
|
+
Avatar
|
|
9
|
+
} from "../Avatar/index.js";
|
|
10
|
+
import {
|
|
11
|
+
SeparatorRoot
|
|
12
|
+
} from "../Separator/index.js";
|
|
13
|
+
import {
|
|
14
|
+
Badge
|
|
15
|
+
} from "../Badge/index.js";
|
|
16
|
+
import"../../chunk-fjtwj9cw.js";
|
|
17
|
+
import {
|
|
18
|
+
cn
|
|
19
|
+
} from "../../utils/cn.js";
|
|
20
|
+
|
|
21
|
+
// src/components/ProfileCard/ProfileCard.tsx
|
|
22
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
23
|
+
function ProfileCard({
|
|
24
|
+
src,
|
|
25
|
+
alt,
|
|
26
|
+
initials,
|
|
27
|
+
avatarColor,
|
|
28
|
+
name,
|
|
29
|
+
role,
|
|
30
|
+
bio,
|
|
31
|
+
badge,
|
|
32
|
+
badgeVariant = "ribbon",
|
|
33
|
+
actions,
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
38
|
+
className: cn("w-72", className),
|
|
39
|
+
...props,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(CardHeader, {
|
|
42
|
+
className: "items-center text-center gap-3 pb-3",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
45
|
+
src,
|
|
46
|
+
alt,
|
|
47
|
+
initials,
|
|
48
|
+
color: avatarColor,
|
|
49
|
+
size: "lg"
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: "space-y-1",
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsx("h3", {
|
|
55
|
+
className: "text-base font-semibold text-kraft",
|
|
56
|
+
children: name
|
|
57
|
+
}),
|
|
58
|
+
role && /* @__PURE__ */ jsx("p", {
|
|
59
|
+
className: "text-sm text-kraft/60",
|
|
60
|
+
children: role
|
|
61
|
+
}),
|
|
62
|
+
badge && /* @__PURE__ */ jsx(Badge, {
|
|
63
|
+
variant: badgeVariant,
|
|
64
|
+
className: "mt-1",
|
|
65
|
+
children: badge
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
bio && /* @__PURE__ */ jsxs(Fragment, {
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ jsx(SeparatorRoot, {}),
|
|
74
|
+
/* @__PURE__ */ jsx(CardContent, {
|
|
75
|
+
className: "pt-4 text-sm text-kraft/70 text-center",
|
|
76
|
+
children: bio
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}),
|
|
80
|
+
actions && /* @__PURE__ */ jsxs(Fragment, {
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(SeparatorRoot, {}),
|
|
83
|
+
/* @__PURE__ */ jsx(CardFooter, {
|
|
84
|
+
className: "justify-center gap-2 pt-4",
|
|
85
|
+
children: actions
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
ProfileCard
|
|
94
|
+
};
|
|
95
|
+
export { ProfileCard };
|
|
96
|
+
|
|
97
|
+
//# debugId=4411D3A3DF55D52264756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/ProfileCard/ProfileCard.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import * as React from 'react';\nimport { Card, CardHeader, CardContent, CardFooter } from '../Card';\nimport { Avatar, type AvatarProps } from '../Avatar';\nimport { Badge, type BadgeProps } from '../Badge';\nimport { SeparatorRoot } from '../Separator';\nimport { cn } from '../../utils/cn';\n\nexport interface ProfileCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Avatar image URL */\n src?: string;\n alt?: string;\n initials?: string;\n avatarColor?: AvatarProps['color'];\n name: string;\n role?: string;\n /** Short bio or description shown below the role */\n bio?: string;\n badge?: string;\n badgeVariant?: BadgeProps['variant'];\n /** Action buttons or links rendered in the card footer */\n actions?: React.ReactNode;\n}\n\nexport function ProfileCard({\n src,\n alt,\n initials,\n avatarColor,\n name,\n role,\n bio,\n badge,\n badgeVariant = 'ribbon',\n actions,\n className,\n ...props\n}: ProfileCardProps) {\n return (\n <Card className={cn('w-72', className)} {...props}>\n <CardHeader className=\"items-center text-center gap-3 pb-3\">\n <Avatar\n src={src}\n alt={alt}\n initials={initials}\n color={avatarColor}\n size=\"lg\"\n />\n <div className=\"space-y-1\">\n <h3 className=\"text-base font-semibold text-kraft\">\n {name}\n </h3>\n {role && <p className=\"text-sm text-kraft/60\">{role}</p>}\n {badge && (\n <Badge variant={badgeVariant} className=\"mt-1\">\n {badge}\n </Badge>\n )}\n </div>\n </CardHeader>\n\n {bio && (\n <>\n <SeparatorRoot />\n <CardContent className=\"pt-4 text-sm text-kraft/70 text-center\">\n {bio}\n </CardContent>\n </>\n )}\n\n {actions && (\n <>\n <SeparatorRoot />\n <CardFooter className=\"justify-center gap-2 pt-4\">\n {actions}\n </CardFooter>\n </>\n )}\n </Card>\n );\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAuBO,SAAS,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,KACG;AAAA,GACc;AAAA,EACjB,uBACI,KAuCE,MAvCF;AAAA,IAAM,WAAW,GAAG,QAAQ,SAAS;AAAA,OAAO;AAAA,IAA5C,UAuCE;AAAA,sBAtCE,KAmBE,YAnBF;AAAA,QAAY,WAAU;AAAA,QAAtB,UAmBE;AAAA,0BAlBE,IAAC,QAAD;AAAA,YACI;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP,MAAK;AAAA,WACT;AAAA,0BACA,KAUE,OAVF;AAAA,YAAK,WAAU;AAAA,YAAf,UAUE;AAAA,8BATE,IAEE,MAFF;AAAA,gBAAI,WAAU;AAAA,gBAAd,UACK;AAAA,eACH;AAAA,cACD,wBAAQ,IAA6C,KAA7C;AAAA,gBAAG,WAAU;AAAA,gBAAb,UAAsC;AAAA,eAAO;AAAA,cACrD,yBACG,IAEE,OAFF;AAAA,gBAAO,SAAS;AAAA,gBAAc,WAAU;AAAA,gBAAxC,UACK;AAAA,eACH;AAAA;AAAA,WAER;AAAA;AAAA,OACJ;AAAA,MAED,uBACG;AAAA,kBAKE;AAAA,0BAJE,IAAC,eAAD,EAAe;AAAA,0BACf,IAEE,aAFF;AAAA,YAAa,WAAU;AAAA,YAAvB,UACK;AAAA,WACH;AAAA;AAAA,OACJ;AAAA,MAGL,2BACG;AAAA,kBAKE;AAAA,0BAJE,IAAC,eAAD,EAAe;AAAA,0BACf,IAEE,YAFF;AAAA,YAAY,WAAU;AAAA,YAAtB,UACK;AAAA,WACH;AAAA;AAAA,OACJ;AAAA;AAAA,GAER;AAAA;",
|
|
8
|
+
"debugId": "4411D3A3DF55D52264756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|