@womp/kookie-ui 0.30.0 → 0.32.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/components.css +56 -51
- package/dist/cjs/components/_internal/page-scope.d.ts +48 -0
- package/dist/cjs/components/_internal/page-scope.d.ts.map +1 -0
- package/dist/cjs/components/_internal/page-scope.js +3 -0
- package/dist/cjs/components/_internal/page-scope.js.map +7 -0
- package/dist/cjs/components/_internal/portal-theme.d.ts +2 -1
- package/dist/cjs/components/_internal/portal-theme.d.ts.map +1 -1
- package/dist/cjs/components/_internal/portal-theme.js +1 -1
- package/dist/cjs/components/_internal/portal-theme.js.map +4 -4
- package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.js.map +4 -4
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +4 -4
- package/dist/cjs/components/chatbar.js +1 -1
- package/dist/cjs/components/chatbar.js.map +4 -4
- package/dist/cjs/components/chip.js +1 -1
- package/dist/cjs/components/chip.js.map +4 -4
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +4 -4
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +4 -4
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.d.ts.map +1 -1
- package/dist/cjs/components/index.js +2 -2
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/link.js.map +3 -3
- package/dist/cjs/components/link.props.d.ts +0 -6
- package/dist/cjs/components/link.props.d.ts.map +1 -1
- package/dist/cjs/components/link.props.js +1 -1
- package/dist/cjs/components/link.props.js.map +3 -3
- package/dist/cjs/components/message-scroller.js +1 -1
- package/dist/cjs/components/message-scroller.js.map +4 -4
- package/dist/cjs/components/navigator.d.ts +11 -7
- package/dist/cjs/components/navigator.d.ts.map +1 -1
- package/dist/cjs/components/navigator.js +1 -1
- package/dist/cjs/components/navigator.js.map +4 -4
- package/dist/cjs/components/notice.js +1 -1
- package/dist/cjs/components/notice.js.map +4 -4
- package/dist/cjs/components/page.d.ts +31 -0
- package/dist/cjs/components/page.d.ts.map +1 -0
- package/dist/cjs/components/page.js +3 -0
- package/dist/cjs/components/page.js.map +7 -0
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +4 -4
- package/dist/cjs/components/select.js +1 -1
- package/dist/cjs/components/select.js.map +4 -4
- package/dist/cjs/components/sheet.js +1 -1
- package/dist/cjs/components/sheet.js.map +4 -4
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +4 -4
- package/dist/cjs/components/toggle.js +1 -1
- package/dist/cjs/components/toggle.js.map +4 -4
- package/dist/cjs/components/toolbar.d.ts +5 -1
- package/dist/cjs/components/toolbar.d.ts.map +1 -1
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +4 -4
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +4 -4
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +3 -3
- package/dist/esm/{chunk-HBO7W7SS.js → chunk-26O4RBOJ.js} +2 -2
- package/dist/esm/chunk-3H33S3UA.js +3 -0
- package/dist/esm/{chunk-C67MM24U.js.map → chunk-3H33S3UA.js.map} +3 -3
- package/dist/esm/{chunk-FYTLUDL3.js → chunk-3M5ZM67R.js} +2 -2
- package/dist/esm/chunk-4B3S2DM7.js +3 -0
- package/dist/esm/chunk-4B3S2DM7.js.map +7 -0
- package/dist/esm/{chunk-NEKIU24N.js → chunk-4ZHBNYXM.js} +2 -2
- package/dist/esm/{chunk-TSS4K2U5.js → chunk-5VYQDA5S.js} +2 -2
- package/dist/esm/chunk-65URNXF2.js +3 -0
- package/dist/esm/chunk-65URNXF2.js.map +7 -0
- package/dist/esm/chunk-6SGJWML7.js +3 -0
- package/dist/esm/chunk-6SGJWML7.js.map +7 -0
- package/dist/esm/{chunk-R4UKO4UK.js → chunk-6WHKGVWY.js} +2 -2
- package/dist/esm/{chunk-7V6M3MIR.js → chunk-7YXHLU4C.js} +2 -2
- package/dist/esm/chunk-AKMRPGNP.js +3 -0
- package/dist/esm/chunk-AKMRPGNP.js.map +7 -0
- package/dist/esm/{chunk-ENQV6SEA.js → chunk-AKSAKP35.js} +2 -2
- package/dist/esm/{chunk-FRFVGYGX.js → chunk-BQOFHLDP.js} +2 -2
- package/dist/esm/{chunk-ZYQEFENG.js → chunk-COLJWVN7.js} +2 -2
- package/dist/esm/{chunk-K3GDM26A.js → chunk-D42VCLKH.js} +2 -2
- package/dist/esm/{chunk-MGWGD6KI.js → chunk-DFQIIYLD.js} +2 -2
- package/dist/esm/{chunk-NWXODCTD.js → chunk-EERKYRYI.js} +2 -2
- package/dist/esm/{chunk-4MNRLB57.js → chunk-FICBVI4M.js} +2 -2
- package/dist/esm/chunk-HGF4CKRY.js +3 -0
- package/dist/esm/chunk-HGF4CKRY.js.map +7 -0
- package/dist/esm/{chunk-JD4KR6VZ.js → chunk-HVMRB3AH.js} +2 -2
- package/dist/esm/{chunk-HLIOHDEX.js → chunk-IFHBMTFX.js} +2 -2
- package/dist/esm/{chunk-J54GYD7A.js → chunk-JFJV4HL3.js} +2 -2
- package/dist/esm/{chunk-KJZSXLIX.js → chunk-JQMWNI62.js} +2 -2
- package/dist/esm/{chunk-CMHKCUHP.js → chunk-K35JUIUT.js} +2 -2
- package/dist/esm/{chunk-67UEMB4K.js → chunk-KBSH6CBD.js} +2 -2
- package/dist/esm/{chunk-SUQJ7DD4.js → chunk-L7PRLW6A.js} +2 -2
- package/dist/esm/{chunk-D2C2A2ZK.js → chunk-LFAUMDU5.js} +2 -2
- package/dist/esm/{chunk-LABMK6Q7.js → chunk-LG5DPQ46.js} +2 -2
- package/dist/esm/{chunk-YMRN5ESN.js → chunk-NFSW36RG.js} +2 -2
- package/dist/esm/{chunk-6YWHNLSC.js → chunk-NJ7RQYLX.js} +2 -2
- package/dist/esm/{chunk-WD66RYF6.js → chunk-NYIYRILR.js} +2 -2
- package/dist/esm/{chunk-JP36JSNP.js → chunk-OBSZOD5M.js} +2 -2
- package/dist/esm/{chunk-DP7MPGR7.js → chunk-OMPLFDS6.js} +2 -2
- package/dist/esm/{chunk-H2J25HXP.js → chunk-OPYTQ34H.js} +2 -2
- package/dist/esm/{chunk-REORAMUH.js → chunk-QBONJMSE.js} +2 -2
- package/dist/esm/chunk-QDAM2I6O.js +3 -0
- package/dist/esm/chunk-QDAM2I6O.js.map +7 -0
- package/dist/esm/chunk-RSG4XWHU.js +2 -0
- package/dist/esm/{chunk-2ZKEQS76.js → chunk-SGKLJDA3.js} +2 -2
- package/dist/esm/{chunk-676Y7ZUT.js → chunk-TMINGBSQ.js} +2 -2
- package/dist/esm/{chunk-2S7HPQVX.js → chunk-TRJAVWCK.js} +2 -2
- package/dist/esm/{chunk-EQE6QQXM.js → chunk-TUZ665BA.js} +2 -2
- package/dist/esm/{chunk-JKQN6QCP.js → chunk-VBF3XALY.js} +2 -2
- package/dist/esm/chunk-VKUAP54W.js +2 -0
- package/dist/esm/chunk-VKUAP54W.js.map +7 -0
- package/dist/esm/chunk-VWRPVM5K.js +3 -0
- package/dist/esm/chunk-VWRPVM5K.js.map +7 -0
- package/dist/esm/{chunk-B6OFKABP.js → chunk-VYF6KKYM.js} +2 -2
- package/dist/esm/{chunk-6UFIS6B2.js → chunk-W35ZKQMQ.js} +2 -2
- package/dist/esm/{chunk-EPGIYTFK.js → chunk-X7DGYRAY.js} +2 -2
- package/dist/esm/{chunk-X7JHZ3HA.js → chunk-XF6Z5NKE.js} +2 -2
- package/dist/esm/{chunk-K5V53KTJ.js → chunk-Y44DYJA5.js} +2 -2
- package/dist/esm/{chunk-MMDZBPSX.js → chunk-YOTTLPJ3.js} +2 -2
- package/dist/esm/chunk-ZBSGH74F.js +3 -0
- package/dist/esm/chunk-ZBSGH74F.js.map +7 -0
- package/dist/esm/chunk-ZHXEEOGI.js +3 -0
- package/dist/esm/chunk-ZHXEEOGI.js.map +7 -0
- package/dist/esm/{chunk-FMVOB367.js → chunk-ZLGOZKB3.js} +2 -2
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/page-scope.d.ts +48 -0
- package/dist/esm/components/_internal/page-scope.d.ts.map +1 -0
- package/dist/esm/components/_internal/page-scope.js +3 -0
- package/dist/esm/components/_internal/page-scope.js.map +7 -0
- package/dist/esm/components/_internal/pane-chrome.js +1 -1
- package/dist/esm/components/_internal/portal-theme.d.ts +2 -1
- package/dist/esm/components/_internal/portal-theme.d.ts.map +1 -1
- package/dist/esm/components/_internal/portal-theme.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/blockquote.js +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/chip.js +1 -1
- package/dist/esm/components/code.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.props.d.ts +0 -6
- package/dist/esm/components/link.props.d.ts.map +1 -1
- package/dist/esm/components/link.props.js +1 -1
- package/dist/esm/components/message-scroller.js +1 -1
- package/dist/esm/components/navbar.js +1 -1
- package/dist/esm/components/navigator.d.ts +11 -7
- package/dist/esm/components/navigator.d.ts.map +1 -1
- package/dist/esm/components/navigator.js +1 -1
- package/dist/esm/components/notice.js +1 -1
- package/dist/esm/components/page.d.ts +31 -0
- package/dist/esm/components/page.d.ts.map +1 -0
- package/dist/esm/components/page.js +3 -0
- package/dist/esm/components/page.js.map +7 -0
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/progress.js +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/switch.js +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/toggle.js +1 -1
- package/dist/esm/components/toolbar.d.ts +5 -1
- package/dist/esm/components/toolbar.d.ts.map +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +1 -1
- package/src/components/_internal/page-scope.tsx +119 -0
- package/src/components/_internal/portal-theme.tsx +6 -2
- package/src/components/_internal/shell-bottom.tsx +4 -1
- package/src/components/_internal/shell-inspector.tsx +4 -1
- package/src/components/_internal/shell-sidebar.tsx +4 -1
- package/src/components/index.css +1 -0
- package/src/components/index.tsx +1 -0
- package/src/components/link.css +16 -46
- package/src/components/link.props.tsx +0 -3
- package/src/components/navigator.tsx +46 -16
- package/src/components/page.css +38 -0
- package/src/components/page.tsx +93 -0
- package/src/components/shell.tsx +8 -2
- package/src/components/toolbar.css +11 -0
- package/src/components/toolbar.tsx +17 -5
- package/styles.css +56 -51
- package/dist/esm/chunk-5KX3RA3P.js +0 -3
- package/dist/esm/chunk-5KX3RA3P.js.map +0 -7
- package/dist/esm/chunk-AQKSO3SW.js +0 -3
- package/dist/esm/chunk-AQKSO3SW.js.map +0 -7
- package/dist/esm/chunk-C67MM24U.js +0 -3
- package/dist/esm/chunk-D74WY6UO.js +0 -3
- package/dist/esm/chunk-D74WY6UO.js.map +0 -7
- package/dist/esm/chunk-E4KT72IB.js +0 -2
- package/dist/esm/chunk-EFXHBH3A.js +0 -2
- package/dist/esm/chunk-EFXHBH3A.js.map +0 -7
- package/dist/esm/chunk-QRV32INS.js +0 -3
- package/dist/esm/chunk-QRV32INS.js.map +0 -7
- package/dist/esm/chunk-VGJALIJ5.js +0 -3
- package/dist/esm/chunk-VGJALIJ5.js.map +0 -7
- package/dist/esm/chunk-WAE4MLBN.js +0 -3
- package/dist/esm/chunk-WAE4MLBN.js.map +0 -7
- package/dist/esm/chunk-YMUERC2J.js +0 -3
- package/dist/esm/chunk-YMUERC2J.js.map +0 -7
- /package/dist/esm/{chunk-HBO7W7SS.js.map → chunk-26O4RBOJ.js.map} +0 -0
- /package/dist/esm/{chunk-FYTLUDL3.js.map → chunk-3M5ZM67R.js.map} +0 -0
- /package/dist/esm/{chunk-NEKIU24N.js.map → chunk-4ZHBNYXM.js.map} +0 -0
- /package/dist/esm/{chunk-TSS4K2U5.js.map → chunk-5VYQDA5S.js.map} +0 -0
- /package/dist/esm/{chunk-R4UKO4UK.js.map → chunk-6WHKGVWY.js.map} +0 -0
- /package/dist/esm/{chunk-7V6M3MIR.js.map → chunk-7YXHLU4C.js.map} +0 -0
- /package/dist/esm/{chunk-ENQV6SEA.js.map → chunk-AKSAKP35.js.map} +0 -0
- /package/dist/esm/{chunk-FRFVGYGX.js.map → chunk-BQOFHLDP.js.map} +0 -0
- /package/dist/esm/{chunk-ZYQEFENG.js.map → chunk-COLJWVN7.js.map} +0 -0
- /package/dist/esm/{chunk-K3GDM26A.js.map → chunk-D42VCLKH.js.map} +0 -0
- /package/dist/esm/{chunk-MGWGD6KI.js.map → chunk-DFQIIYLD.js.map} +0 -0
- /package/dist/esm/{chunk-NWXODCTD.js.map → chunk-EERKYRYI.js.map} +0 -0
- /package/dist/esm/{chunk-4MNRLB57.js.map → chunk-FICBVI4M.js.map} +0 -0
- /package/dist/esm/{chunk-JD4KR6VZ.js.map → chunk-HVMRB3AH.js.map} +0 -0
- /package/dist/esm/{chunk-HLIOHDEX.js.map → chunk-IFHBMTFX.js.map} +0 -0
- /package/dist/esm/{chunk-J54GYD7A.js.map → chunk-JFJV4HL3.js.map} +0 -0
- /package/dist/esm/{chunk-KJZSXLIX.js.map → chunk-JQMWNI62.js.map} +0 -0
- /package/dist/esm/{chunk-CMHKCUHP.js.map → chunk-K35JUIUT.js.map} +0 -0
- /package/dist/esm/{chunk-67UEMB4K.js.map → chunk-KBSH6CBD.js.map} +0 -0
- /package/dist/esm/{chunk-SUQJ7DD4.js.map → chunk-L7PRLW6A.js.map} +0 -0
- /package/dist/esm/{chunk-D2C2A2ZK.js.map → chunk-LFAUMDU5.js.map} +0 -0
- /package/dist/esm/{chunk-LABMK6Q7.js.map → chunk-LG5DPQ46.js.map} +0 -0
- /package/dist/esm/{chunk-YMRN5ESN.js.map → chunk-NFSW36RG.js.map} +0 -0
- /package/dist/esm/{chunk-6YWHNLSC.js.map → chunk-NJ7RQYLX.js.map} +0 -0
- /package/dist/esm/{chunk-WD66RYF6.js.map → chunk-NYIYRILR.js.map} +0 -0
- /package/dist/esm/{chunk-JP36JSNP.js.map → chunk-OBSZOD5M.js.map} +0 -0
- /package/dist/esm/{chunk-DP7MPGR7.js.map → chunk-OMPLFDS6.js.map} +0 -0
- /package/dist/esm/{chunk-H2J25HXP.js.map → chunk-OPYTQ34H.js.map} +0 -0
- /package/dist/esm/{chunk-REORAMUH.js.map → chunk-QBONJMSE.js.map} +0 -0
- /package/dist/esm/{chunk-E4KT72IB.js.map → chunk-RSG4XWHU.js.map} +0 -0
- /package/dist/esm/{chunk-2ZKEQS76.js.map → chunk-SGKLJDA3.js.map} +0 -0
- /package/dist/esm/{chunk-676Y7ZUT.js.map → chunk-TMINGBSQ.js.map} +0 -0
- /package/dist/esm/{chunk-2S7HPQVX.js.map → chunk-TRJAVWCK.js.map} +0 -0
- /package/dist/esm/{chunk-EQE6QQXM.js.map → chunk-TUZ665BA.js.map} +0 -0
- /package/dist/esm/{chunk-JKQN6QCP.js.map → chunk-VBF3XALY.js.map} +0 -0
- /package/dist/esm/{chunk-B6OFKABP.js.map → chunk-VYF6KKYM.js.map} +0 -0
- /package/dist/esm/{chunk-6UFIS6B2.js.map → chunk-W35ZKQMQ.js.map} +0 -0
- /package/dist/esm/{chunk-EPGIYTFK.js.map → chunk-X7DGYRAY.js.map} +0 -0
- /package/dist/esm/{chunk-X7JHZ3HA.js.map → chunk-XF6Z5NKE.js.map} +0 -0
- /package/dist/esm/{chunk-K5V53KTJ.js.map → chunk-Y44DYJA5.js.map} +0 -0
- /package/dist/esm/{chunk-MMDZBPSX.js.map → chunk-YOTTLPJ3.js.map} +0 -0
- /package/dist/esm/{chunk-FMVOB367.js.map → chunk-ZLGOZKB3.js.map} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface PageProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title'> {
|
|
3
|
+
/**
|
|
4
|
+
* The title of the page. It shows large at the top. When it scrolls away, it also shows in
|
|
5
|
+
* the `Toolbar.Title` of the pane's band. It is a string, because it shows in two places.
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/** A sentence under the title that describes the page. Optional. */
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
/** A logo or mark above the title, such as an app's logo on its home page. Most pages don't need it. */
|
|
11
|
+
mark?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Page, from v2 (2026-11-03): the screen you navigated to, and its title.
|
|
15
|
+
*
|
|
16
|
+
* A page is not a band. The pinned row with the way back and the tools is the pane's
|
|
17
|
+
* (`Shell.PaneHeader`): it stays while you move from page to page. The large title that arrives
|
|
18
|
+
* and leaves with the content is the page's, and it is this.
|
|
19
|
+
*
|
|
20
|
+
* It owns three things: the air above its title (a floating band's reach is already cleared by
|
|
21
|
+
* `Shell.Scroll`), the title and its description at the page's type steps, and the collapse:
|
|
22
|
+
* when the title passes behind the band, every `Toolbar.Title` with no words of its own in this
|
|
23
|
+
* pane shows the page's title.
|
|
24
|
+
*
|
|
25
|
+
* It takes no width (the frame around it states one), no level (a page is the document's one
|
|
26
|
+
* `h1`), no size (an app has one page step) and no actions (they go in the toolbar).
|
|
27
|
+
*/
|
|
28
|
+
declare const Page: React.ForwardRefExoticComponent<PageProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export { Page };
|
|
30
|
+
export type { PageProps };
|
|
31
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/components/page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,UAAU,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACxF;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wGAAwG;IACxG,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,IAAI,kFAmDR,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";"use client";var ie=Object.create;var R=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty;var ue=(t,e)=>{for(var o in e)R(t,o,{get:e[o],enumerable:!0})},K=(t,e,o,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ae(e))!fe.call(t,a)&&a!==o&&R(t,a,{get:()=>e[a],enumerable:!(p=pe(e,a))||p.enumerable});return t};var d=(t,e,o)=>(o=t!=null?ie(le(t)):{},K(e||!t||!t.__esModule?R(o,"default",{value:t,enumerable:!0}):o,t)),ce=t=>K(R({},"__esModule",{value:!0}),t);var We={};ue(We,{Page:()=>se});module.exports=ce(We);var c=d(require("react")),ne=d(require("classnames"));var m=d(require("react")),me=m.createContext(null);function B(t){t.version+=1;for(let e of t.listeners)e()}function E(t,e){if(t.collapsed!==e){t.collapsed=e;for(let o of t.mirrors)e?o.setAttribute("data-collapsed",""):o.removeAttribute("data-collapsed")}}function U(){return m.useContext(me)}function q(t,e){m.useEffect(()=>{if(t)return t.title=e,B(t),()=>{t.title===e&&(t.title=null,B(t))}},[t,e])}var I=d(require("react")),de="(max-width: 767.98px) and (pointer: coarse)",F,Y=()=>F??(F=window.matchMedia(de));function Pe(t,e){return typeof t.addEventListener=="function"?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener?.(e),()=>t.removeListener?.(e))}function ge(t){return Pe(Y(),t)}function _(){return I.useSyncExternalStore(ge,()=>Y().matches,()=>!1)}var g=d(require("react")),te=require("radix-ui");var h={asChild:{type:"boolean"}};var ye=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var x={color:{type:"enum",values:ye,default:void 0}};var De=["loud","medium","quiet"],S={emphasis:{type:"enum",className:"kui-emphasis",values:De,default:void 0}};var ve=["normal","start","end","both"],b={trim:{type:"enum",className:"kui-r-lt",values:ve,responsive:!0}};var Re=["left","center","right"],T={align:{type:"enum",className:"kui-r-ta",values:Re,responsive:!0}};var he=["wrap","nowrap","pretty","balance"],C={wrap:{type:"enum",className:"kui-r-tw",values:he,responsive:!0}};var N={truncate:{type:"boolean",className:"kui-truncate"}};var xe=["sans","mono","serif"],k={font:{type:"enum",className:"kui-r-ff",values:xe}};var Se=["regular","medium","semibold"],H={weight:{type:"enum",className:"kui-r-weight",values:Se,responsive:!0}};var be=["h1","h2","h3","h4","h5","h6"],Te=["1","2","3","4","5","6","7","8","9"],Q={as:{type:"enum",values:be,default:"h2"},...h,size:{type:"enum",className:"kui-r-size",values:Te,default:"6",responsive:!0},...k,...H,...T,...b,...N,...C,...x,...S};var ee=d(require("classnames"));var Ce=[],Ne=new Set;function ke(t){let e=Object.assign({},...t),o=[],p=[],a=new Set;for(let l in e){let n=e[l],s=n.values??Ce,i={key:l,type:n.type,default:n.default,hasDefault:n.default!==void 0,responsive:"responsive"in n,className:n.className,customProperties:n.customProperties,parseValue:n.parseValue,values:s,valueSet:s.length>0?new Set(s):Ne,enumValueSet:n.type==="enum"?new Set([n.default,...s]):void 0};n.className?(o.push(i),a.add(l)):(i.hasDefault||n.type==="enum")&&p.push(i)}return{styling:o,passthrough:p,stylingKeys:a}}var He={children:new WeakMap};function J(t){let e=He;for(let o=0;o<t.length;o++){let p=t[o],a=e.children.get(p);a===void 0&&(a={children:new WeakMap},e.children.set(p,a)),e=a}return e.compiled??(e.compiled=ke(t))}var we=["initial","xs","sm","md","lg","xl"],j=new Set(we);function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Ve=new Set(["initial","xs","sm","md","lg","xl"]);function P(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(Ve.has(e))return!0;return!1}function w(t,e,o){return e!==void 0?e.has(o):t.includes(o)}function Z({className:t,customProperties:e,...o}){let p=M({allowArbitraryValues:!0,className:t,...o}),a=Ee({customProperties:e,...o});return[p,a]}function M({allowArbitraryValues:t,value:e,className:o,propValues:p,propValueSet:a,parseValue:l=n=>n}){if(e){if(typeof e=="string")return w(p,a,e)?X(o,e,l):t?o:void 0;if(P(e)){let n=e,s=[];for(let i in n){if(!O(n,i)||!j.has(i))continue;let r=n[i];if(r!==void 0){if(w(p,a,r)){let f=X(o,r,l),u=i==="initial"?f:`${i}:${f}`;s.push(u)}else if(t){let f=i==="initial"?o:`${i}:${o}`;s.push(f)}}}return s.length>0?s.join(" "):""}if(t)return o}}function X(t,e,o){let p=t?"-":"",a=o(e),l=a?.startsWith("-"),n=l?"-":"",s=l?a?.substring(1):a;return`${n}${t}${p}${s}`}function Ee({customProperties:t,value:e,propValues:o,propValueSet:p,parseValue:a=l=>l}){if(!e||typeof e=="string"&&w(o,p,e))return;let l;if(typeof e=="string"){let n=a(e);l={};for(let s of t)l[s]=n;return l}if(P(e)){let n=e;for(let s in n){if(!O(n,s)||!j.has(s))continue;let i=n[s];if(i===void 0||w(o,p,i))continue;let r=a(i);l??(l={});for(let f of t){let u=s==="initial"?f:`${f}-${s}`;l[u]=r}}}return l??{}}function W(...t){let e;for(let o of t)o&&(e===void 0&&(e={}),Object.assign(e,o));return e}function je(t,e){let o=t.initial,p=!1;return e.hasDefault&&o===void 0&&(o=e.default,p=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(o)&&(o=e.default,p=!0),p?{...t,initial:o}:t}function V(t,...e){let{styling:o,passthrough:p,stylingKeys:a}=J(e),l={};for(let i in t)a.has(i)||(l[i]=t[i]);for(let i=0;i<p.length;i++){let r=p[i],f=l[r.key];if(f===void 0){r.hasDefault&&(l[r.key]=r.default);continue}r.enumValueSet!==void 0&&!r.enumValueSet.has(f)&&!P(f)&&(l[r.key]=r.default)}let n,s=[];for(let i=0;i<o.length;i++){let r=o[i],f=t[r.key];if(f===void 0&&r.hasDefault&&(f=r.default),r.enumValueSet!==void 0&&!r.enumValueSet.has(f)&&!P(f)&&(f=r.default),!!f){if(P(f)){if(!r.responsive)continue;f=je(f,r)}if(r.type==="enum"){let u=M({allowArbitraryValues:!1,value:f,className:r.className,propValues:r.values,propValueSet:r.valueSet,parseValue:r.parseValue});u&&s.push(u);continue}if(r.type==="string"||r.type==="enum | string"){let[u,D]=Z({className:r.className,customProperties:r.customProperties,propValues:r.type==="string"?[]:r.values,propValueSet:r.type==="string"?void 0:r.valueSet,parseValue:r.parseValue,value:f});D&&(n=W(n,D)),u&&s.push(u);continue}if(r.type==="boolean"){s.push(r.className);continue}}}return l.className=(0,ee.default)(s.length>0?s.join(" "):void 0,t.className),l.style=W(n,t.style),l}var L=g.memo(g.forwardRef((t,e)=>{let{children:o,className:p,asChild:a,as:l="h2",color:n,...s}=V(t,Q),i=p?`kui-Heading ${p}`:"kui-Heading";return a?g.createElement(te.Slot.Root,{"data-accent-color":n,...s,ref:e,className:i},o):g.createElement(l,{"data-accent-color":n,...s,ref:e,className:i},o)}));L.displayName="Heading";var y=d(require("react")),re=require("radix-ui");var Oe=["span","div","label","p"],Me=["1","2","3","4","5","6","7","8","9"],oe={as:{type:"enum",values:Oe,default:"span"},...h,size:{type:"enum",className:"kui-r-size",values:Me,responsive:!0},...k,...H,...T,...b,...N,...C,...x,...S};var A=y.memo(y.forwardRef((t,e)=>{let{children:o,className:p,asChild:a,as:l="span",color:n,...s}=V(t,oe),i=p?`kui-Text ${p}`:"kui-Text";return a?y.createElement(re.Slot.Root,{"data-accent-color":n,...s,ref:e,className:i},o):y.createElement(l,{"data-accent-color":n,...s,ref:e,className:i},o)}));A.displayName="Text";var se=c.forwardRef(({title:t,description:e,mark:o,className:p,children:a,...l},n)=>{let s=U(),i=c.useRef(null);q(s,t);let r=_();return c.useEffect(()=>{let f=i.current;if(!f||!s)return;let u=f.closest(".kui-ScrollAreaViewport"),D=u!==null&&!/^(visible|clip)$/.test(getComputedStyle(u).overflowY),$=new IntersectionObserver(G=>{let v=G[G.length-1];if(!v)return;let z=v.rootBounds?.top;E(s,!v.isIntersecting&&(z===void 0||v.boundingClientRect.top<=z))},{root:D?u:null,threshold:0});return $.observe(f),()=>{$.disconnect(),E(s,!1)}},[s,r]),c.createElement("div",{...l,ref:n,className:(0,ne.default)("kui-Page",p)},c.createElement("div",{className:"kui-PageHeader"},o==null?null:c.createElement("div",{className:"kui-PageMark"},o),c.createElement(L,{as:"h1",size:"9",weight:"medium"},t),e==null?null:c.createElement(A,{as:"p",size:"4"},e),c.createElement("div",{ref:i,className:"kui-PageMarker","aria-hidden":"true"})),a)});se.displayName="Page";
|
|
3
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/page.tsx", "../../../src/components/_internal/page-scope.tsx", "../../../src/components/_internal/shell-page-scroll.ts", "../../../src/components/heading.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/color.prop.ts", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/heading.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/components/text.tsx", "../../../src/components/text.props.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { setPageCollapsed, useClaimPage, usePageScope } from './_internal/page-scope.js';\nimport { usePageScrollMedia } from './_internal/shell-page-scroll.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\n\ninterface PageProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title'> {\n /**\n * The title of the page. It shows large at the top. When it scrolls away, it also shows in\n * the `Toolbar.Title` of the pane's band. It is a string, because it shows in two places.\n */\n title: string;\n /** A sentence under the title that describes the page. Optional. */\n description?: React.ReactNode;\n /** A logo or mark above the title, such as an app's logo on its home page. Most pages don't need it. */\n mark?: React.ReactNode;\n}\n\n/**\n * Page, from v2 (2026-11-03): the screen you navigated to, and its title.\n *\n * A page is not a band. The pinned row with the way back and the tools is the pane's\n * (`Shell.PaneHeader`): it stays while you move from page to page. The large title that arrives\n * and leaves with the content is the page's, and it is this.\n *\n * It owns three things: the air above its title (a floating band's reach is already cleared by\n * `Shell.Scroll`), the title and its description at the page's type steps, and the collapse:\n * when the title passes behind the band, every `Toolbar.Title` with no words of its own in this\n * pane shows the page's title.\n *\n * It takes no width (the frame around it states one), no level (a page is the document's one\n * `h1`), no size (an app has one page step) and no actions (they go in the toolbar).\n */\nconst Page = React.forwardRef<HTMLDivElement, PageProps>(({ title, description, mark, className, children, ...props }, forwardedRef) => {\n const store = usePageScope();\n const marker = React.useRef<HTMLDivElement>(null);\n useClaimPage(store, title);\n\n // Re-read when a touch window crosses the phone boundary: the scroller changes from the\n // content's viewport to the page, and an observer built for one never fires for the other.\n const pageScrolls = usePageScrollMedia();\n React.useEffect(() => {\n const el = marker.current;\n if (!el || !store) return;\n // The scroller is the viewport around this, if it scrolls; on a phone window Shell the\n // document scrolls and the viewport is `overflow: visible`, so the root is the document.\n const viewport = el.closest<HTMLElement>('.kui-ScrollAreaViewport');\n const scrolls = viewport !== null && !/^(visible|clip)$/.test(getComputedStyle(viewport).overflowY);\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[entries.length - 1];\n if (!entry) return;\n // Gone off the top, not merely gone: a marker below the fold is also out of view.\n const top = entry.rootBounds?.top;\n setPageCollapsed(store, !entry.isIntersecting && (top === undefined || entry.boundingClientRect.top <= top));\n },\n { root: scrolls ? viewport : null, threshold: 0 },\n );\n observer.observe(el);\n return () => {\n observer.disconnect();\n // A page that unmounts takes its collapse with it, or the next page's band opens collapsed.\n setPageCollapsed(store, false);\n };\n }, [store, pageScrolls]);\n\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-Page', className)}>\n <div className=\"kui-PageHeader\">\n {mark === undefined || mark === null ? null : <div className=\"kui-PageMark\">{mark}</div>}\n <Heading as=\"h1\" size=\"9\" weight=\"medium\">\n {title}\n </Heading>\n {description === undefined || description === null ? null : (\n <Text as=\"p\" size=\"4\">\n {description}\n </Text>\n )}\n {/* Out of flow, so it displaces nothing and a page with no band behaves the same. */}\n <div ref={marker} className=\"kui-PageMarker\" aria-hidden=\"true\" />\n </div>\n {children}\n </div>\n );\n});\nPage.displayName = 'Page';\n\nexport { Page };\nexport type { PageProps };\n", "'use client';\n\nimport * as React from 'react';\n\n/**\n * What page is in a pane, and whether its title has scrolled away (from v2, 2026-11-03).\n *\n * A page's large title lives inside the scroller and the band that shows it again lives beside\n * it, so context, which only flows down, cannot carry it from one to the other. The store sits\n * at their common ancestor, the pane. Each pane provides its own, so two panes can each hold a\n * titled page; `Shell.Header` provides none, so a `Toolbar.Title` there always speaks for itself.\n * Outside a Shell there is no scope: a `Page` still draws its heading and a `Toolbar.Title` still\n * shows its own words.\n */\ntype PageStore = {\n /** The words of the page in this pane, or null while nothing has claimed it. */\n title: string | null;\n /** Every `Toolbar.Title` mirroring this pane's page, as elements: the collapse is written onto them. */\n mirrors: Set<HTMLElement>;\n /** Whether the page's own title has scrolled up behind the band. */\n collapsed: boolean;\n listeners: Set<() => void>;\n /** What a subscriber reads: a stable value between notifications. */\n version: number;\n};\n\nconst PageScopeContext = React.createContext<PageStore | null>(null);\n\nfunction notify(store: PageStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\n/**\n * The collapse is an attribute write, not a render: only CSS reads it, and an observer sends it\n * twice per visit to a page.\n */\nfunction setPageCollapsed(store: PageStore, collapsed: boolean): void {\n if (store.collapsed === collapsed) return;\n store.collapsed = collapsed;\n for (const el of store.mirrors) {\n if (collapsed) el.setAttribute('data-collapsed', '');\n else el.removeAttribute('data-collapsed');\n }\n}\n\n/** Every pane renders one. It draws nothing. */\nfunction PageScope({ children }: { children: React.ReactNode }) {\n const store = React.useMemo<PageStore>(() => ({ title: null, mirrors: new Set(), collapsed: false, listeners: new Set(), version: 0 }), []);\n return <PageScopeContext.Provider value={store}>{children}</PageScopeContext.Provider>;\n}\n\n/** Cuts the scope off below a portal: a panel over a pane is not in it, so its title must not take the pane's band. */\nfunction NoPageScope({ children }: { children: React.ReactNode }) {\n return <PageScopeContext.Provider value={null}>{children}</PageScopeContext.Provider>;\n}\n\nfunction usePageScope(): PageStore | null {\n return React.useContext(PageScopeContext);\n}\n\n/** A `Page` claims the pane it is in, in an effect, so no subscriber's snapshot changes mid-render. */\nfunction useClaimPage(store: PageStore | null, title: string): void {\n React.useEffect(() => {\n if (!store) return;\n store.title = title;\n notify(store);\n return () => {\n if (store.title === title) {\n store.title = null;\n notify(store);\n }\n };\n }, [store, title]);\n}\n\n/** What a `Toolbar.Title` shows when it is given no words of its own. */\nfunction usePageTitle(store: PageStore | null): string | null {\n const subscribe = React.useCallback(\n (cb: () => void) => {\n if (!store) return () => {};\n store.listeners.add(cb);\n return () => {\n store.listeners.delete(cb);\n };\n },\n [store],\n );\n // The version is read so the subscription re-renders this consumer; the title itself is the value.\n React.useSyncExternalStore(\n subscribe,\n () => store?.version ?? 0,\n () => 0,\n );\n return store?.title ?? null;\n}\n\n/**\n * Registers a mirroring title's element, stamped with what the page is doing now: a title that\n * mounts after its page has scrolled arrives collapsed.\n */\nfunction usePageMirror(store: PageStore | null): React.RefCallback<HTMLElement> {\n const current = React.useRef<HTMLElement | null>(null);\n return React.useCallback(\n (el: HTMLElement | null) => {\n if (!store) return;\n if (current.current) store.mirrors.delete(current.current);\n current.current = el;\n if (!el) return;\n store.mirrors.add(el);\n if (store.collapsed) el.setAttribute('data-collapsed', '');\n else el.removeAttribute('data-collapsed');\n },\n [store],\n );\n}\n\nexport { PageScope, NoPageScope, usePageScope, useClaimPage, usePageTitle, usePageMirror, setPageCollapsed };\nexport type { PageStore };\n", "'use client';\n\nimport * as React from 'react';\n\n/**\n * When a window Shell lets the page scroll: a narrow window (below the `sm` breakpoint) under a\n * coarse pointer. The stylesheet decides it (shell.css, the page-scroll block), so first paint is\n * right with no script. This is the script's copy, for the few things only script can do when the\n * answer changes: carry the reading position between the two scrollers, and take the content's\n * unused viewport out of the tab order. A test holds it equal to the stylesheet's.\n */\nexport const PAGE_SCROLL_QUERY = '(max-width: 767.98px) and (pointer: coarse)';\n\nlet list: MediaQueryList | undefined;\nconst media = () => (list ??= window.matchMedia(PAGE_SCROLL_QUERY));\n\nfunction listen(m: MediaQueryList, handler: () => void): () => void {\n // Safari below 14 has only the deprecated listener API.\n if (typeof m.addEventListener === 'function') {\n m.addEventListener('change', handler);\n return () => m.removeEventListener('change', handler);\n }\n m.addListener?.(handler);\n return () => m.removeListener?.(handler);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n return listen(media(), onChange);\n}\n\n/** True where a window Shell lets the page scroll. False on the server and through hydration. */\nexport function usePageScrollMedia(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => media().matches,\n () => false,\n );\n}\n\n/** Whether the page scrolls right now. */\nexport function pageScrollMatches(): boolean {\n return media().matches;\n}\n\n/** Subscribes to the answer changing, outside React. */\nexport function onPageScrollMediaChange(onChange: (matches: boolean) => void): () => void {\n const m = media();\n return listen(m, () => onChange(m.matches));\n}\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { headingPropDefs } from './heading.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype HeadingElement = React.ElementRef<'h2'>;\ntype HeadingOwnProps = GetPropDefTypes<typeof headingPropDefs>;\ninterface CommonHeadingProps extends HeadingOwnProps {}\ntype HeadingH1Props = { as: 'h1' } & ComponentPropsWithout<'h1', RemovedProps>;\ntype HeadingH2Props = { as?: 'h2' } & ComponentPropsWithout<'h2', RemovedProps>;\ntype HeadingH3Props = { as: 'h3' } & ComponentPropsWithout<'h3', RemovedProps>;\ntype HeadingH4Props = { as: 'h4' } & ComponentPropsWithout<'h4', RemovedProps>;\ntype HeadingH5Props = { as: 'h5' } & ComponentPropsWithout<'h5', RemovedProps>;\ntype HeadingH6Props = { as: 'h6' } & ComponentPropsWithout<'h6', RemovedProps>;\ntype HeadingProps = CommonHeadingProps &\n (HeadingH1Props | HeadingH2Props | HeadingH3Props | HeadingH4Props | HeadingH5Props | HeadingH6Props);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Heading = React.memo(\n React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'h2',\n color,\n ...headingProps\n } = extractProps(props, headingPropDefs);\n\n const combinedClassName = className ? `kui-Heading ${className}` : 'kui-Heading';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...headingProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(headingProps as React.HTMLAttributes<HTMLHeadingElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nHeading.displayName = 'Heading';\n\nexport { Heading };\nexport type { HeadingProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst headingPropDefs = {\n as: { type: 'enum', values: as, default: 'h2' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n default: '6',\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { headingPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n"],
|
|
5
|
+
"mappings": ";mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,UAAAE,KAAA,eAAAC,GAAAH,IAEA,IAAAI,EAAuB,oBACvBC,GAAuB,yBCDvB,IAAAC,EAAuB,oBAwBjBC,GAAyB,gBAAgC,IAAI,EAEnE,SAASC,EAAOC,EAAkB,CAChCA,EAAM,SAAW,EACjB,QAAWC,KAAYD,EAAM,UAAWC,EAAS,CACnD,CAMA,SAASC,EAAiBF,EAAkBG,EAA0B,CACpE,GAAIH,EAAM,YAAcG,EACxB,CAAAH,EAAM,UAAYG,EAClB,QAAWC,KAAMJ,EAAM,QACjBG,EAAWC,EAAG,aAAa,iBAAkB,EAAE,EAC9CA,EAAG,gBAAgB,gBAAgB,EAE5C,CAaA,SAASC,GAAiC,CACxC,OAAa,aAAWC,EAAgB,CAC1C,CAGA,SAASC,EAAaC,EAAyBC,EAAqB,CAC5D,YAAU,IAAM,CACpB,GAAKD,EACL,OAAAA,EAAM,MAAQC,EACdC,EAAOF,CAAK,EACL,IAAM,CACPA,EAAM,QAAUC,IAClBD,EAAM,MAAQ,KACdE,EAAOF,CAAK,EAEhB,CACF,EAAG,CAACA,EAAOC,CAAK,CAAC,CACnB,CCxEA,IAAAE,EAAuB,oBASVC,GAAoB,8CAE7BC,EACEC,EAAQ,IAAOD,MAAS,OAAO,WAAWD,EAAiB,GAEjE,S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,EACrBC,EAAe,SAAuB,IAAI,EAChDC,EAAaH,EAAOP,CAAK,EAIzB,IAAMW,EAAcC,EAAmB,EACvC,OAAM,YAAU,IAAM,CACpB,IAAMC,EAAKJ,EAAO,QAClB,GAAI,CAACI,GAAM,CAACN,EAAO,OAGnB,IAAMO,EAAWD,EAAG,QAAqB,yBAAyB,EAC5DE,EAAUD,IAAa,MAAQ,CAAC,mBAAmB,KAAK,iBAAiBA,CAAQ,EAAE,SAAS,EAC5FE,EAAW,IAAI,qBAClBC,GAAY,CACX,IAAMC,EAAQD,EAAQA,EAAQ,OAAS,CAAC,EACxC,GAAI,CAACC,EAAO,OAEZ,IAAMC,EAAMD,EAAM,YAAY,IAC9BE,EAAiBb,EAAO,CAACW,EAAM,iBAAmBC,IAAQ,QAAaD,EAAM,mBAAmB,KAAOC,EAAI,CAC7G,EACA,CAAE,KAAMJ,EAAUD,EAAW,KAAM,UAAW,CAAE,CAClD,EACA,OAAAE,EAAS,QAAQH,CAAE,EACZ,IAAM,CACXG,EAAS,WAAW,EAEpBI,EAAiBb,EAAO,EAAK,CAC/B,CACF,EAAG,CAACA,EAAOI,CAAW,CAAC,EAGrB,gBAAC,OAAK,GAAGN,EAAO,IAAKC,EAAc,aAAW,GAAAe,SAAW,WAAYlB,CAAS,GAC5E,gBAAC,OAAI,UAAU,kBACUD,GAAS,KAAO,KAAO,gBAAC,OAAI,UAAU,gBAAgBA,CAAK,EAClF,gBAACoB,EAAA,CAAQ,GAAG,KAAK,KAAK,IAAI,OAAO,UAC9BtB,CACH,EAC8BC,GAAgB,KAAO,KACnD,gBAACsB,EAAA,CAAK,GAAG,IAAI,KAAK,KACftB,CACH,EAGF,gBAAC,OAAI,IAAKQ,EAAQ,UAAU,iBAAiB,cAAY,OAAO,CAClE,EACCL,CACH,CAEJ,CAAC,EACDL,GAAK,YAAc",
|
|
6
|
+
"names": ["page_exports", "__export", "Page", "__toCommonJS", "React", "import_classnames", "React", "PageScopeContext", "notify", "store", "listener", "setPageCollapsed", "collapsed", "el", "usePageScope", "PageScopeContext", "useClaimPage", "store", "title", "notify", "React", "PAGE_SCROLL_QUERY", "list", "media", "listen", "m", "handler", "subscribe", "onChange", "usePageScrollMedia", "React", "import_radix_ui", "asChildPropDef", "accentColors", "colorPropDef", "accentColors", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "headingPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "Heading", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "headingProps", "extractProps", "headingPropDefs", "combinedClassName", "React", "import_radix_ui", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "Page", "title", "description", "mark", "className", "children", "props", "forwardedRef", "store", "usePageScope", "marker", "useClaimPage", "pageScrolls", "usePageScrollMedia", "el", "viewport", "scrolls", "observer", "entries", "entry", "top", "setPageCollapsed", "classNames", "Heading", "Text"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var Ee=Object.create;var V=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty;var Ge=(e,o)=>{for(var t in o)V(e,t,{get:o[t],enumerable:!0})},oe=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of Ae(o))!je.call(e,a)&&a!==t&&V(e,a,{get:()=>o[a],enumerable:!(s=Ve(o,a))||s.enumerable});return e};var y=(e,o,t)=>(t=e!=null?Ee(He(e)):{},oe(o||!e||!e.__esModule?V(t,"default",{value:e,enumerable:!0}):t,e)),Oe=e=>oe(V({},"__esModule",{value:!0}),e);var eo={};Ge(eo,{Anchor:()=>Se,Close:()=>xe,Content:()=>be,Root:()=>Re,Toolbar:()=>Xe,Trigger:()=>De});module.exports=Oe(eo);var i=y(require("react")),T=y(require("classnames")),v=require("radix-ui");var se=y(require("classnames"));var We=[],Ie=new Set;function Be(e){let o=Object.assign({},...e),t=[],s=[],a=new Set;for(let p in o){let r=o[p],c=r.values??We,l={key:p,type:r.type,default:r.default,hasDefault:r.default!==void 0,responsive:"responsive"in r,className:r.className,customProperties:r.customProperties,parseValue:r.parseValue,values:c,valueSet:c.length>0?new Set(c):Ie,enumValueSet:r.type==="enum"?new Set([r.default,...c]):void 0};r.className?(t.push(l),a.add(p)):(l.hasDefault||r.type==="enum")&&s.push(l)}return{styling:t,passthrough:s,stylingKeys:a}}var Le={children:new WeakMap};function te(e){let o=Le;for(let t=0;t<e.length;t++){let s=e[t],a=o.children.get(s);a===void 0&&(a={children:new WeakMap},o.children.set(s,a)),o=a}return o.compiled??(o.compiled=Be(e))}var Me=["initial","xs","sm","md","lg","xl"],M=new Set(Me);function $(e,o){return Object.prototype.hasOwnProperty.call(e,o)}var $e=new Set(["initial","xs","sm","md","lg","xl"]);function C(e){if(typeof e!="object"||e===null)return!1;for(let o in e)if($e.has(o))return!0;return!1}function A(e,o,t){return o!==void 0?o.has(t):e.includes(t)}function ne({className:e,customProperties:o,...t}){let s=K({allowArbitraryValues:!0,className:e,...t}),a=Ke({customProperties:o,...t});return[s,a]}function K({allowArbitraryValues:e,value:o,className:t,propValues:s,propValueSet:a,parseValue:p=r=>r}){if(o){if(typeof o=="string")return A(s,a,o)?re(t,o,p):e?t:void 0;if(C(o)){let r=o,c=[];for(let l in r){if(!$(r,l)||!M.has(l))continue;let n=r[l];if(n!==void 0){if(A(s,a,n)){let f=re(t,n,p),d=l==="initial"?f:`${l}:${f}`;c.push(d)}else if(e){let f=l==="initial"?t:`${l}:${t}`;c.push(f)}}}return c.length>0?c.join(" "):""}if(e)return t}}function re(e,o,t){let s=e?"-":"",a=t(o),p=a?.startsWith("-"),r=p?"-":"",c=p?a?.substring(1):a;return`${r}${e}${s}${c}`}function Ke({customProperties:e,value:o,propValues:t,propValueSet:s,parseValue:a=p=>p}){if(!o||typeof o=="string"&&A(t,s,o))return;let p;if(typeof o=="string"){let r=a(o);p={};for(let c of e)p[c]=r;return p}if(C(o)){let r=o;for(let c in r){if(!$(r,c)||!M.has(c))continue;let l=r[c];if(l===void 0||A(t,s,l))continue;let n=a(l);p??(p={});for(let f of e){let d=c==="initial"?f:`${f}-${c}`;p[d]=n}}}return p??{}}function U(...e){let o;for(let t of e)t&&(o===void 0&&(o={}),Object.assign(o,t));return o}function Ue(e,o){let t=e.initial,s=!1;return o.hasDefault&&t===void 0&&(t=o.default,s=!0),o.enumValueSet!==void 0&&!o.enumValueSet.has(t)&&(t=o.default,s=!0),s?{...e,initial:t}:e}function ae(e,...o){let{styling:t,passthrough:s,stylingKeys:a}=te(o),p={};for(let l in e)a.has(l)||(p[l]=e[l]);for(let l=0;l<s.length;l++){let n=s[l],f=p[n.key];if(f===void 0){n.hasDefault&&(p[n.key]=n.default);continue}n.enumValueSet!==void 0&&!n.enumValueSet.has(f)&&!C(f)&&(p[n.key]=n.default)}let r,c=[];for(let l=0;l<t.length;l++){let n=t[l],f=e[n.key];if(f===void 0&&n.hasDefault&&(f=n.default),n.enumValueSet!==void 0&&!n.enumValueSet.has(f)&&!C(f)&&(f=n.default),!!f){if(C(f)){if(!n.responsive)continue;f=Ue(f,n)}if(n.type==="enum"){let d=K({allowArbitraryValues:!1,value:f,className:n.className,propValues:n.values,propValueSet:n.valueSet,parseValue:n.parseValue});d&&c.push(d);continue}if(n.type==="string"||n.type==="enum | string"){let[d,g]=ne({className:n.className,customProperties:n.customProperties,propValues:n.type==="string"?[]:n.values,propValueSet:n.type==="string"?void 0:n.valueSet,parseValue:n.parseValue,value:f});g&&(r=U(r,g)),d&&c.push(d);continue}if(n.type==="boolean"){c.push(n.className);continue}}}return p.className=(0,se.default)(c.length>0?c.join(" "):void 0,e.className),p.style=U(r,e.style),p}var H=y(require("react"));function ie(e,o){if(o.includes(e))return e;let t=Number(e),s=o[0],a=1/0;for(let p=0;p<o.length;p++){let r=Math.abs(Number(o[p])-t);r<a&&(a=r,s=o[p])}return s}var j=H.createContext("2");j.displayName="ThemeSizeContext";function pe(e,o){let t=H.useContext(j);if(e.size!==void 0)return e;let s=ie(t,o.values);return s===o.default?e:{...e,size:s}}var G=y(require("react")),q=e=>{if(!G.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${G.Children.toArray(e).map(t=>typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type:typeof t).join(", ")}`);return e};var O={asChild:{type:"boolean"}};var le={height:{type:"string",className:"kui-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"kui-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"kui-r-max-h",customProperties:["--max-height"],responsive:!0}};var W={width:{type:"string",className:"kui-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"kui-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"kui-r-max-w",customProperties:["--max-width"],responsive:!0}};var _e=["1","2","3","4"],_={...O,size:{type:"enum",className:"kui-r-size",values:_e,default:"2",responsive:!0},width:W.width,minWidth:W.minWidth,maxWidth:{...W.maxWidth,default:"480px"},...le};var b=y(require("react"));var u=y(require("react")),Pe=y(require("classnames")),D=require("radix-ui");function ce(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Y=y(require("react"));function h(e){let[o,t]=Y.useState(e),[s,a]=Y.useState(e);return Object.is(e,s)||(a(e),t(e)),[o,t]}var fe=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],me=["auto","gray","mauve","slate","sage","olive","sand"];var ue=["none","small","medium","large","full"];var Ye=["inherit","light","dark"],de=["sans","mono","serif"],Ze=["1","2","3","4"],m={...O,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:Ye,default:"inherit"},accentColor:{type:"enum",values:fe,default:"gray"},grayColor:{type:"enum",values:me,default:"gray"},radius:{type:"enum",values:ue,default:"full"},fontFamily:{type:"enum",values:de,default:"sans"},headingFontFamily:{type:"enum",values:de},size:{type:"enum",values:Ze,default:"2"}};var P=()=>{},Io={appearance:m.appearance.default,accentColor:m.accentColor.default,grayColor:m.grayColor.default,resolvedGrayColor:m.grayColor.default,radius:m.radius.default,fontFamily:m.fontFamily.default,headingFontFamily:void 0,size:m.size.default,onAppearanceChange:P,onAccentColorChange:P,onGrayColorChange:P,onRadiusChange:P,onFontFamilyChange:P,onHeadingFontFamilyChange:P,onSizeChange:P},Z=u.createContext(void 0);var J=u.forwardRef((e,o)=>{let t=u.useContext(Z),s=D.Direction.useDirection();return t===void 0?u.createElement(D.Direction.Provider,{dir:s},u.createElement(ye,{...e,ref:o})):u.createElement(Q,{...e,ref:o})});J.displayName="Theme";var ye=u.forwardRef((e,o)=>{let{appearance:t=m.appearance.default,accentColor:s=m.accentColor.default,grayColor:a=m.grayColor.default,radius:p=m.radius.default,fontFamily:r=m.fontFamily.default,headingFontFamily:c,size:l=m.size.default,hasBackground:n=m.hasBackground.default,...f}=e,[d,g]=h(t),[x,S]=h(s),[N,F]=h(a),[k,w]=h(p),[z,E]=h(r),[I,R]=h(c),[B,L]=h(l);return u.createElement(Q,{...f,ref:o,isRoot:!0,hasBackground:n,appearance:d,accentColor:x,grayColor:N,radius:k,fontFamily:z,headingFontFamily:I,size:B,onAppearanceChange:g,onAccentColorChange:S,onGrayColorChange:F,onRadiusChange:w,onFontFamilyChange:E,onHeadingFontFamilyChange:R,onSizeChange:L})});ye.displayName="ThemeRoot";var Q=u.forwardRef((e,o)=>{let t=u.useContext(Z),{asChild:s,isRoot:a,hasBackground:p,appearance:r=e.appearance??t?.appearance??m.appearance.default,accentColor:c=e.accentColor??t?.accentColor??m.accentColor.default,grayColor:l=e.grayColor??t?.resolvedGrayColor??m.grayColor.default,radius:n=e.radius??t?.radius??m.radius.default,fontFamily:f=e.fontFamily??t?.fontFamily??m.fontFamily.default,headingFontFamily:d=e.headingFontFamily??t?.headingFontFamily,size:g=e.size??t?.size??m.size.default,onAppearanceChange:x=t?.onAppearanceChange??P,onAccentColorChange:S=t?.onAccentColorChange??P,onGrayColorChange:N=t?.onGrayColorChange??P,onRadiusChange:F=t?.onRadiusChange??P,onFontFamilyChange:k=t?.onFontFamilyChange??P,onHeadingFontFamilyChange:w=t?.onHeadingFontFamilyChange??P,onSizeChange:z=t?.onSizeChange??P,...E}=e,I=s?D.Slot.Root:"div",R=l==="auto"?ce(c):l,B=e.appearance==="light"||e.appearance==="dark",L=p===void 0?a||B:p;return u.createElement(Z.Provider,{value:u.useMemo(()=>({appearance:r,accentColor:c,grayColor:l,resolvedGrayColor:R,radius:n,fontFamily:f,headingFontFamily:d,size:g,onAppearanceChange:x,onAccentColorChange:S,onGrayColorChange:N,onRadiusChange:F,onFontFamilyChange:k,onHeadingFontFamilyChange:w,onSizeChange:z}),[r,c,l,R,n,f,d,g,x,S,N,F,k,w,z])},u.createElement(j.Provider,{value:g},u.createElement(I,{"data-is-root-theme":a?"true":"false","data-accent-color":c,"data-gray-color":R,"data-has-background":L?"true":"false","data-radius":n,"data-font-family":f,"data-heading-font-family":d,ref:o,...E,className:(0,Pe.default)("kui-theme",{light:r==="light",dark:r==="dark"},E.className)})))});Q.displayName="ThemeImpl";var ge=y(require("react")),he=ge.createContext(void 0);var X=b.forwardRef((e,o)=>b.createElement(he.Provider,{value:null},b.createElement(J,{...e,ref:o})));X.displayName="PortalTheme";var ve=y(require("react")),Ce=ve.createContext(null);var Te=i.createContext(null),ee=e=>{let o=i.useContext(Te);return o};function Je({children:e}){let o=ee("Navigator")?.setLabelId,t=i.useId();return i.useEffect(()=>(o?.(t),()=>o?.(void 0)),[t,o]),i.cloneElement(e,{id:t})}var Qe={Title:Je,Close:({children:e})=>i.createElement(v.Popover.Close,{asChild:!0},e)},Re=e=>i.createElement(v.Popover.Root,{...e});Re.displayName="Popover.Root";var De=i.forwardRef(({children:e,...o},t)=>i.createElement(v.Popover.Trigger,{...o,ref:t,asChild:!0},q(e)));De.displayName="Popover.Trigger";var be=i.forwardRef((e,o)=>{let t=pe(e,_.size),{className:s,forceMount:a,container:p,...r}=ae(t,_),[c,l]=i.useState(void 0),n=i.useMemo(()=>({setLabelId:l}),[]);return i.createElement(v.Popover.Portal,{container:p,forceMount:a},i.createElement(X,{asChild:!0},i.createElement(v.Popover.Content,{align:"start",sideOffset:8,collisionPadding:10,...r,ref:o,"aria-labelledby":c??r["aria-labelledby"],className:(0,T.default)("kui-PopperContent","kui-PopoverContent",s)},i.createElement(Te.Provider,{value:n},i.createElement(Ce.Provider,{value:Qe},t.children)))))});be.displayName="Popover.Content";var xe=i.forwardRef(({children:e,...o},t)=>i.createElement(v.Popover.Close,{...o,ref:t,asChild:!0},q(e)));xe.displayName="Popover.Close";var Se=i.forwardRef((e,o)=>i.createElement(v.Popover.Anchor,{...e,ref:o}));Se.displayName="Popover.Anchor";var Ne=i.forwardRef(({className:e,children:o,...t},s)=>(ee("Popover.Toolbar"),i.createElement("div",{...t,ref:s,className:(0,T.default)("kui-PopoverToolbar",e)},o)));Ne.displayName="Popover.Toolbar";var Fe=i.forwardRef(({className:e,...o},t)=>i.createElement("div",{...o,ref:t,className:(0,T.default)("kui-PopoverToolbarSection","kui-PopoverToolbarLeft",e)}));Fe.displayName="Popover.Toolbar.Left";var ke=i.forwardRef(({className:e,...o},t)=>i.createElement("div",{...o,ref:t,className:(0,T.default)("kui-PopoverToolbarSection","kui-PopoverToolbarCenter",e)}));ke.displayName="Popover.Toolbar.Center";var we=i.forwardRef(({className:e,...o},t)=>i.createElement("div",{...o,ref:t,className:(0,T.default)("kui-PopoverToolbarSection","kui-PopoverToolbarRight",e)}));we.displayName="Popover.Toolbar.Right";var ze=i.forwardRef(({className:e,id:o,...t},s)=>{let a=ee("Popover.Toolbar.Title"),p=i.useId(),r=o??`kui-popover-toolbar-title-${p}`;return i.useEffect(()=>(a?.setLabelId(r),()=>a?.setLabelId(void 0)),[a,r]),i.createElement("span",{...t,id:r,ref:s,className:(0,T.default)("kui-PopoverToolbarTitle",e)})});ze.displayName="Popover.Toolbar.Title";var Xe=Object.assign(Ne,{Left:Fe,Center:ke,Right:we,Title:ze});
|
|
2
|
+
"use strict";var Ve=Object.create;var V=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ge=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var We=(e,o)=>{for(var t in o)V(e,t,{get:o[t],enumerable:!0})},te=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of je(o))!Oe.call(e,a)&&a!==t&&V(e,a,{get:()=>o[a],enumerable:!(s=He(o,a))||s.enumerable});return e};var y=(e,o,t)=>(t=e!=null?Ve(Ge(e)):{},te(o||!e||!e.__esModule?V(t,"default",{value:e,enumerable:!0}):t,e)),Ie=e=>te(V({},"__esModule",{value:!0}),e);var ro={};We(ro,{Anchor:()=>Fe,Close:()=>Ne,Content:()=>xe,Root:()=>De,Toolbar:()=>to,Trigger:()=>Se});module.exports=Ie(ro);var i=y(require("react")),T=y(require("classnames")),C=require("radix-ui");var ae=y(require("classnames"));var Me=[],Le=new Set;function Be(e){let o=Object.assign({},...e),t=[],s=[],a=new Set;for(let p in o){let r=o[p],c=r.values??Me,l={key:p,type:r.type,default:r.default,hasDefault:r.default!==void 0,responsive:"responsive"in r,className:r.className,customProperties:r.customProperties,parseValue:r.parseValue,values:c,valueSet:c.length>0?new Set(c):Le,enumValueSet:r.type==="enum"?new Set([r.default,...c]):void 0};r.className?(t.push(l),a.add(p)):(l.hasDefault||r.type==="enum")&&s.push(l)}return{styling:t,passthrough:s,stylingKeys:a}}var $e={children:new WeakMap};function re(e){let o=$e;for(let t=0;t<e.length;t++){let s=e[t],a=o.children.get(s);a===void 0&&(a={children:new WeakMap},o.children.set(s,a)),o=a}return o.compiled??(o.compiled=Be(e))}var Ke=["initial","xs","sm","md","lg","xl"],$=new Set(Ke);function K(e,o){return Object.prototype.hasOwnProperty.call(e,o)}var Ue=new Set(["initial","xs","sm","md","lg","xl"]);function R(e){if(typeof e!="object"||e===null)return!1;for(let o in e)if(Ue.has(o))return!0;return!1}function H(e,o,t){return o!==void 0?o.has(t):e.includes(t)}function se({className:e,customProperties:o,...t}){let s=U({allowArbitraryValues:!0,className:e,...t}),a=qe({customProperties:o,...t});return[s,a]}function U({allowArbitraryValues:e,value:o,className:t,propValues:s,propValueSet:a,parseValue:p=r=>r}){if(o){if(typeof o=="string")return H(s,a,o)?ne(t,o,p):e?t:void 0;if(R(o)){let r=o,c=[];for(let l in r){if(!K(r,l)||!$.has(l))continue;let n=r[l];if(n!==void 0){if(H(s,a,n)){let f=ne(t,n,p),d=l==="initial"?f:`${l}:${f}`;c.push(d)}else if(e){let f=l==="initial"?t:`${l}:${t}`;c.push(f)}}}return c.length>0?c.join(" "):""}if(e)return t}}function ne(e,o,t){let s=e?"-":"",a=t(o),p=a?.startsWith("-"),r=p?"-":"",c=p?a?.substring(1):a;return`${r}${e}${s}${c}`}function qe({customProperties:e,value:o,propValues:t,propValueSet:s,parseValue:a=p=>p}){if(!o||typeof o=="string"&&H(t,s,o))return;let p;if(typeof o=="string"){let r=a(o);p={};for(let c of e)p[c]=r;return p}if(R(o)){let r=o;for(let c in r){if(!K(r,c)||!$.has(c))continue;let l=r[c];if(l===void 0||H(t,s,l))continue;let n=a(l);p??(p={});for(let f of e){let d=c==="initial"?f:`${f}-${c}`;p[d]=n}}}return p??{}}function q(...e){let o;for(let t of e)t&&(o===void 0&&(o={}),Object.assign(o,t));return o}function _e(e,o){let t=e.initial,s=!1;return o.hasDefault&&t===void 0&&(t=o.default,s=!0),o.enumValueSet!==void 0&&!o.enumValueSet.has(t)&&(t=o.default,s=!0),s?{...e,initial:t}:e}function ie(e,...o){let{styling:t,passthrough:s,stylingKeys:a}=re(o),p={};for(let l in e)a.has(l)||(p[l]=e[l]);for(let l=0;l<s.length;l++){let n=s[l],f=p[n.key];if(f===void 0){n.hasDefault&&(p[n.key]=n.default);continue}n.enumValueSet!==void 0&&!n.enumValueSet.has(f)&&!R(f)&&(p[n.key]=n.default)}let r,c=[];for(let l=0;l<t.length;l++){let n=t[l],f=e[n.key];if(f===void 0&&n.hasDefault&&(f=n.default),n.enumValueSet!==void 0&&!n.enumValueSet.has(f)&&!R(f)&&(f=n.default),!!f){if(R(f)){if(!n.responsive)continue;f=_e(f,n)}if(n.type==="enum"){let d=U({allowArbitraryValues:!1,value:f,className:n.className,propValues:n.values,propValueSet:n.valueSet,parseValue:n.parseValue});d&&c.push(d);continue}if(n.type==="string"||n.type==="enum | string"){let[d,h]=se({className:n.className,customProperties:n.customProperties,propValues:n.type==="string"?[]:n.values,propValueSet:n.type==="string"?void 0:n.valueSet,parseValue:n.parseValue,value:f});h&&(r=q(r,h)),d&&c.push(d);continue}if(n.type==="boolean"){c.push(n.className);continue}}}return p.className=(0,ae.default)(c.length>0?c.join(" "):void 0,e.className),p.style=q(r,e.style),p}var j=y(require("react"));function pe(e,o){if(o.includes(e))return e;let t=Number(e),s=o[0],a=1/0;for(let p=0;p<o.length;p++){let r=Math.abs(Number(o[p])-t);r<a&&(a=r,s=o[p])}return s}var G=j.createContext("2");G.displayName="ThemeSizeContext";function le(e,o){let t=j.useContext(G);if(e.size!==void 0)return e;let s=pe(t,o.values);return s===o.default?e:{...e,size:s}}var O=y(require("react")),_=e=>{if(!O.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${O.Children.toArray(e).map(t=>typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type:typeof t).join(", ")}`);return e};var W={asChild:{type:"boolean"}};var ce={height:{type:"string",className:"kui-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"kui-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"kui-r-max-h",customProperties:["--max-height"],responsive:!0}};var I={width:{type:"string",className:"kui-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"kui-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"kui-r-max-w",customProperties:["--max-width"],responsive:!0}};var Ze=["1","2","3","4"],Y={...W,size:{type:"enum",className:"kui-r-size",values:Ze,default:"2",responsive:!0},width:I.width,minWidth:I.minWidth,maxWidth:{...I.maxWidth,default:"480px"},...ce};var b=y(require("react"));var u=y(require("react")),ye=y(require("classnames")),S=require("radix-ui");function fe(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Z=y(require("react"));function v(e){let[o,t]=Z.useState(e),[s,a]=Z.useState(e);return Object.is(e,s)||(a(e),t(e)),[o,t]}var me=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],ue=["auto","gray","mauve","slate","sage","olive","sand"];var de=["none","small","medium","large","full"];var Je=["inherit","light","dark"],Pe=["sans","mono","serif"],Qe=["1","2","3","4"],m={...W,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:Je,default:"inherit"},accentColor:{type:"enum",values:me,default:"gray"},grayColor:{type:"enum",values:ue,default:"gray"},radius:{type:"enum",values:de,default:"full"},fontFamily:{type:"enum",values:Pe,default:"sans"},headingFontFamily:{type:"enum",values:Pe},size:{type:"enum",values:Qe,default:"2"}};var P=()=>{},Bo={appearance:m.appearance.default,accentColor:m.accentColor.default,grayColor:m.grayColor.default,resolvedGrayColor:m.grayColor.default,radius:m.radius.default,fontFamily:m.fontFamily.default,headingFontFamily:void 0,size:m.size.default,onAppearanceChange:P,onAccentColorChange:P,onGrayColorChange:P,onRadiusChange:P,onFontFamilyChange:P,onHeadingFontFamilyChange:P,onSizeChange:P},J=u.createContext(void 0);var Q=u.forwardRef((e,o)=>{let t=u.useContext(J),s=S.Direction.useDirection();return t===void 0?u.createElement(S.Direction.Provider,{dir:s},u.createElement(ge,{...e,ref:o})):u.createElement(X,{...e,ref:o})});Q.displayName="Theme";var ge=u.forwardRef((e,o)=>{let{appearance:t=m.appearance.default,accentColor:s=m.accentColor.default,grayColor:a=m.grayColor.default,radius:p=m.radius.default,fontFamily:r=m.fontFamily.default,headingFontFamily:c,size:l=m.size.default,hasBackground:n=m.hasBackground.default,...f}=e,[d,h]=v(t),[x,N]=v(s),[F,k]=v(a),[E,w]=v(p),[z,A]=v(r),[M,D]=v(c),[L,B]=v(l);return u.createElement(X,{...f,ref:o,isRoot:!0,hasBackground:n,appearance:d,accentColor:x,grayColor:F,radius:E,fontFamily:z,headingFontFamily:M,size:L,onAppearanceChange:h,onAccentColorChange:N,onGrayColorChange:k,onRadiusChange:w,onFontFamilyChange:A,onHeadingFontFamilyChange:D,onSizeChange:B})});ge.displayName="ThemeRoot";var X=u.forwardRef((e,o)=>{let t=u.useContext(J),{asChild:s,isRoot:a,hasBackground:p,appearance:r=e.appearance??t?.appearance??m.appearance.default,accentColor:c=e.accentColor??t?.accentColor??m.accentColor.default,grayColor:l=e.grayColor??t?.resolvedGrayColor??m.grayColor.default,radius:n=e.radius??t?.radius??m.radius.default,fontFamily:f=e.fontFamily??t?.fontFamily??m.fontFamily.default,headingFontFamily:d=e.headingFontFamily??t?.headingFontFamily,size:h=e.size??t?.size??m.size.default,onAppearanceChange:x=t?.onAppearanceChange??P,onAccentColorChange:N=t?.onAccentColorChange??P,onGrayColorChange:F=t?.onGrayColorChange??P,onRadiusChange:k=t?.onRadiusChange??P,onFontFamilyChange:E=t?.onFontFamilyChange??P,onHeadingFontFamilyChange:w=t?.onHeadingFontFamilyChange??P,onSizeChange:z=t?.onSizeChange??P,...A}=e,M=s?S.Slot.Root:"div",D=l==="auto"?fe(c):l,L=e.appearance==="light"||e.appearance==="dark",B=p===void 0?a||L:p;return u.createElement(J.Provider,{value:u.useMemo(()=>({appearance:r,accentColor:c,grayColor:l,resolvedGrayColor:D,radius:n,fontFamily:f,headingFontFamily:d,size:h,onAppearanceChange:x,onAccentColorChange:N,onGrayColorChange:F,onRadiusChange:k,onFontFamilyChange:E,onHeadingFontFamilyChange:w,onSizeChange:z}),[r,c,l,D,n,f,d,h,x,N,F,k,E,w,z])},u.createElement(G.Provider,{value:h},u.createElement(M,{"data-is-root-theme":a?"true":"false","data-accent-color":c,"data-gray-color":D,"data-has-background":B?"true":"false","data-radius":n,"data-font-family":f,"data-heading-font-family":d,ref:o,...A,className:(0,ye.default)("kui-theme",{light:r==="light",dark:r==="dark"},A.className)})))});X.displayName="ThemeImpl";var he=y(require("react")),ve=he.createContext(void 0);var g=y(require("react")),Xe=g.createContext(null);function Ce({children:e}){return g.createElement(Xe.Provider,{value:null},e)}var ee=b.forwardRef((e,o)=>b.createElement(ve.Provider,{value:null},b.createElement(Ce,null,b.createElement(Q,{...e,ref:o}))));ee.displayName="PortalTheme";var Re=y(require("react")),Te=Re.createContext(null);var be=i.createContext(null),oe=e=>{let o=i.useContext(be);return o};function eo({children:e}){let o=oe("Navigator")?.setLabelId,t=i.useId();return i.useEffect(()=>(o?.(t),()=>o?.(void 0)),[t,o]),i.cloneElement(e,{id:t})}var oo={Title:eo,Close:({children:e})=>i.createElement(C.Popover.Close,{asChild:!0},e)},De=e=>i.createElement(C.Popover.Root,{...e});De.displayName="Popover.Root";var Se=i.forwardRef(({children:e,...o},t)=>i.createElement(C.Popover.Trigger,{...o,ref:t,asChild:!0},_(e)));Se.displayName="Popover.Trigger";var xe=i.forwardRef((e,o)=>{let t=le(e,Y.size),{className:s,forceMount:a,container:p,...r}=ie(t,Y),[c,l]=i.useState(void 0),n=i.useMemo(()=>({setLabelId:l}),[]);return i.createElement(C.Popover.Portal,{container:p,forceMount:a},i.createElement(ee,{asChild:!0},i.createElement(C.Popover.Content,{align:"start",sideOffset:8,collisionPadding:10,...r,ref:o,"aria-labelledby":c??r["aria-labelledby"],className:(0,T.default)("kui-PopperContent","kui-PopoverContent",s)},i.createElement(be.Provider,{value:n},i.createElement(Te.Provider,{value:oo},t.children)))))});xe.displayName="Popover.Content";var Ne=i.forwardRef(({children:e,...o},t)=>i.createElement(C.Popover.Close,{...o,ref:t,asChild:!0},_(e)));Ne.displayName="Popover.Close";var Fe=i.forwardRef((e,o)=>i.createElement(C.Popover.Anchor,{...e,ref:o}));Fe.displayName="Popover.Anchor";var ke=i.forwardRef(({className:e,children:o,...t},s)=>(oe("Popover.Toolbar"),i.createElement("div",{...t,ref:s,className:(0,T.default)("kui-PopoverToolbar",e)},o)));ke.displayName="Popover.Toolbar";var Ee=i.forwardRef(({className:e,...o},t)=>i.createElement("div",{...o,ref:t,className:(0,T.default)("kui-PopoverToolbarSection","kui-PopoverToolbarLeft",e)}));Ee.displayName="Popover.Toolbar.Left";var we=i.forwardRef(({className:e,...o},t)=>i.createElement("div",{...o,ref:t,className:(0,T.default)("kui-PopoverToolbarSection","kui-PopoverToolbarCenter",e)}));we.displayName="Popover.Toolbar.Center";var ze=i.forwardRef(({className:e,...o},t)=>i.createElement("div",{...o,ref:t,className:(0,T.default)("kui-PopoverToolbarSection","kui-PopoverToolbarRight",e)}));ze.displayName="Popover.Toolbar.Right";var Ae=i.forwardRef(({className:e,id:o,...t},s)=>{let a=oe("Popover.Toolbar.Title"),p=i.useId(),r=o??`kui-popover-toolbar-title-${p}`;return i.useEffect(()=>(a?.setLabelId(r),()=>a?.setLabelId(void 0)),[a,r]),i.createElement("span",{...t,id:r,ref:s,className:(0,T.default)("kui-PopoverToolbarTitle",e)})});Ae.displayName="Popover.Toolbar.Title";var to=Object.assign(ke,{Left:Ee,Center:we,Right:ze,Title:Ae});
|
|
3
3
|
//# sourceMappingURL=popover.js.map
|