@apple-pie/slice 0.1.24 → 0.1.25
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/dist/cjs/chunks/{AudioBubble-C8HdYBY8.js → AudioBubble-Bqb2Jexf.js} +1 -0
- package/dist/cjs/chunks/{Avatar-CUaQ3kN1.js → Avatar-Dg8ZHnw6.js} +1 -0
- package/dist/cjs/chunks/{AvatarGroup-B3M7o4Hh.js → AvatarGroup-F8eSiMwn.js} +2 -1
- package/dist/cjs/chunks/{Badge-CY_DG6cD.js → Badge-DjPJ_iJX.js} +1 -0
- package/dist/cjs/chunks/{Button-DmWbooXb.js → Button-D3wZtdtj.js} +2 -1
- package/dist/cjs/chunks/{ButtonBar-RSBwFaU-.js → ButtonBar-EH8fHFhS.js} +6 -5
- package/dist/cjs/chunks/{Camera-CLm3aQR8.js → Camera-BnsGhOrt.js} +2 -1
- package/dist/cjs/chunks/{CheckBox-DDINn56u.js → CheckBox-CEWLxffo.js} +2 -1
- package/dist/cjs/chunks/{Chip-DRSg6kLh.js → Chip-BrQgOmJc.js} +2 -1
- package/dist/cjs/chunks/{DivInput-DO3Dgbjp.js → DivInput-DWPwVUs_.js} +1 -0
- package/dist/cjs/chunks/{Dot-_HCJ3qxd.js → Dot-fKIwhjYA.js} +1 -0
- package/dist/cjs/chunks/{DrggablePanel-CERavfv3.js → DrggablePanel-Duv0nmOm.js} +22 -16
- package/dist/cjs/chunks/{DropDown-Cy2o78yw.js → DropDown-Bf_pm-Go.js} +2 -1
- package/dist/cjs/chunks/{ErrorSummary-BfVHS893.js → ErrorSummary-K_rPxGWK.js} +1 -0
- package/dist/cjs/chunks/{FileIcon-xoD-xIme.js → FileIcon-DgRlhqzv.js} +1 -0
- package/dist/cjs/chunks/{FileList-DjTXjXnK.js → FileList-DobAcOSH.js} +2 -1
- package/dist/cjs/chunks/{_types-Sa2RAJ2U.js → FlexDiv-C-3ahI-j.js} +79 -9
- package/dist/cjs/chunks/{Grouper-RYRxazG9.js → Grouper-D9G8PKoM.js} +2 -1
- package/dist/cjs/chunks/{Icon-BB-t50Yt.js → Icon-fRM3E0N6.js} +20 -3
- package/dist/cjs/chunks/{IconButton-BUw3YUsI.js → IconButton-Cf2RBUKA.js} +7 -6
- package/dist/cjs/chunks/{Label-NzMpkZo2.js → Label-Bxp2pCXf.js} +1 -0
- package/dist/cjs/chunks/{Overlay-BX6vXX9F.js → Overlay-DDOvMM6L.js} +1 -0
- package/dist/cjs/chunks/{Pager-BN37VYEC.js → Pager-DO197OyC.js} +1 -0
- package/dist/cjs/chunks/{ProgressIndicator-8QZwTSyY.js → ProgressIndicator-t-jv4OhI.js} +2 -1
- package/dist/cjs/chunks/{PromptInput-D1wP5-uN.js → PromptInput-B1WG22xz.js} +2 -1
- package/dist/cjs/chunks/{RadioButton-Cvqum7dU.js → RadioButton-BAIMCshV.js} +2 -1
- package/dist/cjs/chunks/{RadioButtonList-CPHTioGa.js → RadioButtonList-Bsg5oFaC.js} +2 -1
- package/dist/cjs/chunks/{Slider-CnXBacf-.js → Slider-BAcaZUs2.js} +1 -0
- package/dist/cjs/chunks/{Spacer-CtxV2Pww.js → Spacer-CyZAUR5N.js} +1 -0
- package/dist/cjs/chunks/{Switch-Cbn0ql3B.js → Switch-Crm-nHYI.js} +1 -0
- package/dist/cjs/chunks/{TabBar-CnD3E-qa.js → TabBar-BfyfjmPQ.js} +2 -1
- package/dist/cjs/chunks/{TextArea-CtJi771p.js → TextArea-CHNWsfWH.js} +2 -1
- package/dist/cjs/chunks/{TextField-B2u_CZKk.js → TextField-2xzSdIx3.js} +2 -1
- package/dist/cjs/chunks/{Tip-DAxoyMyA.js → Tip-DceuNR6k.js} +1 -0
- package/dist/cjs/chunks/{Toast-D2fpwdjF.js → Toast-C8Hc9ZKI.js} +2 -1
- package/dist/cjs/chunks/{UploadArea-BS2BPuhZ.js → UploadArea-UFWRQ-nW.js} +2 -1
- package/dist/cjs/chunks/{_types-BD6txsj1.js → _types-VoADvwjb.js} +1 -0
- package/dist/cjs/components/AudioBubble/index.js +1 -1
- package/dist/cjs/components/Avatar/index.js +1 -1
- package/dist/cjs/components/AvatarGroup/index.js +2 -2
- package/dist/cjs/components/Badge/index.js +1 -1
- package/dist/cjs/components/Button/index.js +4 -4
- package/dist/cjs/components/ButtonBar/index.js +2 -2
- package/dist/cjs/components/Camera/index.js +3 -3
- package/dist/cjs/components/CheckBox/index.js +2 -2
- package/dist/cjs/components/Chip/index.js +2 -2
- package/dist/cjs/components/DivInput/index.js +1 -1
- package/dist/cjs/components/Dot/index.js +1 -1
- package/dist/cjs/components/DraggablePanel/index.js +1 -1
- package/dist/cjs/components/DropDown/index.js +2 -2
- package/dist/cjs/components/ErrorSummary/index.js +1 -1
- package/dist/cjs/components/FileIcon/index.js +1 -1
- package/dist/cjs/components/FileList/index.js +4 -4
- package/dist/cjs/components/FlexDiv/index.js +9 -4
- package/dist/cjs/components/Grouper/index.js +3 -3
- package/dist/cjs/components/Icon/index.js +1 -1
- package/dist/cjs/components/IconButton/index.js +3 -3
- package/dist/cjs/components/Label/index.js +1 -1
- package/dist/cjs/components/Overlay/index.js +1 -1
- package/dist/cjs/components/Pager/index.js +1 -1
- package/dist/cjs/components/Progress/index.js +2 -2
- package/dist/cjs/components/PromptInput/index.js +7 -7
- package/dist/cjs/components/RadioButton/index.js +2 -2
- package/dist/cjs/components/RadioButtonList/index.js +3 -3
- package/dist/cjs/components/Slider/index.js +1 -1
- package/dist/cjs/components/Spacer/index.js +1 -1
- package/dist/cjs/components/Switch/index.js +1 -1
- package/dist/cjs/components/TabBar/index.js +4 -4
- package/dist/cjs/components/TextArea/index.js +5 -5
- package/dist/cjs/components/Textfield/index.js +6 -6
- package/dist/cjs/components/Tip/index.js +1 -1
- package/dist/cjs/components/Toast/index.js +2 -2
- package/dist/cjs/components/UploadArea/index.js +5 -5
- package/dist/cjs/hooks/useAudioRecorder.js +1 -0
- package/dist/cjs/hooks/useDoubleClick.js +1 -0
- package/dist/cjs/hooks/useKeyboardShortcuts.js +1 -0
- package/dist/cjs/hooks/useLastUpdated.js +1 -0
- package/dist/cjs/hooks/useLocalStore.js +1 -0
- package/dist/cjs/hooks/useMdStreamBuffer.js +1 -0
- package/dist/cjs/hooks/useMicrophone.js +1 -0
- package/dist/cjs/hooks/useObserveResize.js +1 -0
- package/dist/cjs/hooks/useObserveTheme.js +1 -0
- package/dist/cjs/hooks/useTheme.js +1 -0
- package/dist/cjs/hooks/useToolTip.js +1 -0
- package/dist/cjs/hooks/useTrackRenders.js +1 -0
- package/dist/cjs/hooks/useWindow.js +2 -0
- package/dist/cjs/index.js +11 -6
- package/dist/cjs/providers/ThemeProvider.js +11 -9
- package/dist/cjs/providers/themeServer.js +24 -0
- package/dist/cjs/providers.js +3 -2
- package/dist/esm/chunks/{AudioBubble-DFh3Vxl6.mjs → AudioBubble-DZfzkdlq.mjs} +1 -0
- package/dist/esm/chunks/{Avatar-C8uV7ROZ.mjs → Avatar-m5-zleDk.mjs} +1 -0
- package/dist/esm/chunks/{AvatarGroup-Bt1Lkn5S.mjs → AvatarGroup-DlgP4lTS.mjs} +2 -1
- package/dist/esm/chunks/{Badge-D-U1jomY.mjs → Badge-CC0zSLMf.mjs} +1 -0
- package/dist/esm/chunks/{Button-sEYjFcR2.mjs → Button-YER9dCLE.mjs} +5 -4
- package/dist/esm/chunks/{ButtonBar-DSR2lhhN.mjs → ButtonBar-BH4pcEpN.mjs} +6 -5
- package/dist/esm/chunks/{Camera-DSSiOeJd.mjs → Camera-BJJpDuuA.mjs} +3 -2
- package/dist/esm/chunks/{CheckBox-B6zWSySW.mjs → CheckBox-Cf2l3-D9.mjs} +2 -1
- package/dist/esm/chunks/{Chip-BBKJ6wG4.mjs → Chip-DWp7p2BF.mjs} +2 -1
- package/dist/esm/chunks/{DivInput-cIMIH07H.mjs → DivInput-WJltaCra.mjs} +1 -0
- package/dist/esm/chunks/{Dot-Cj6gWj4_.mjs → Dot-DZE134mJ.mjs} +1 -0
- package/dist/esm/chunks/{DrggablePanel-CQcIbxpX.mjs → DrggablePanel-DA7pYWg6.mjs} +22 -16
- package/dist/esm/chunks/{DropDown-DFUc_rjP.mjs → DropDown-BQ2tNN3_.mjs} +2 -1
- package/dist/esm/chunks/{ErrorSummary-Mz9siVxm.mjs → ErrorSummary-EzCqVifm.mjs} +1 -0
- package/dist/esm/chunks/{FileIcon-DeW-ZBiv.mjs → FileIcon-Cufsp1gn.mjs} +1 -0
- package/dist/esm/chunks/{FileList-0Dzx15hl.mjs → FileList-BQ9X5YnB.mjs} +4 -3
- package/dist/esm/chunks/{_types-DOQAaLqq.mjs → FlexDiv-BFrVoFhC.mjs} +82 -13
- package/dist/esm/chunks/{Grouper-B04WxD6K.mjs → Grouper-CvPYEsF_.mjs} +3 -2
- package/dist/esm/chunks/{Icon-KDwlMXzH.mjs → Icon-DI32kOA1.mjs} +20 -3
- package/dist/esm/chunks/{IconButton-oAB8ZFTf.mjs → IconButton-Dciw5CLn.mjs} +9 -8
- package/dist/esm/chunks/{Label-BD7VlTDw.mjs → Label-CvCDAg1y.mjs} +1 -0
- package/dist/esm/chunks/{Overlay-3KkyDm1f.mjs → Overlay-DiSvgIQP.mjs} +1 -0
- package/dist/esm/chunks/{Pager-DmiwYLl5.mjs → Pager-BoDLaKFh.mjs} +1 -0
- package/dist/esm/chunks/{ProgressIndicator-CxsZm_As.mjs → ProgressIndicator-CB_oazMD.mjs} +2 -1
- package/dist/esm/chunks/{PromptInput-D4Q-DWjz.mjs → PromptInput-plgRiAb7.mjs} +3 -2
- package/dist/esm/chunks/{RadioButton-B0jvM5VW.mjs → RadioButton-B6ImCUYY.mjs} +2 -1
- package/dist/esm/chunks/{RadioButtonList-DBRAv87_.mjs → RadioButtonList-Cf6gk8yp.mjs} +2 -1
- package/dist/esm/chunks/{Slider-CONGTXUE.mjs → Slider-Cav86rU6.mjs} +1 -0
- package/dist/esm/chunks/{Spacer-C5fcJYq-.mjs → Spacer-C5651N0N.mjs} +1 -0
- package/dist/esm/chunks/{Switch-CyoaJwSX.mjs → Switch-RfA431T4.mjs} +1 -0
- package/dist/esm/chunks/{TabBar-DmO1ixBz.mjs → TabBar-0zpJ9GtN.mjs} +4 -3
- package/dist/esm/chunks/{TextArea-DaB8g-fZ.mjs → TextArea-B64bIPHm.mjs} +2 -1
- package/dist/esm/chunks/{TextField-BGeEJXUJ.mjs → TextField-BZeoN_ye.mjs} +4 -3
- package/dist/esm/chunks/{Tip-DrQvxDsH.mjs → Tip-C5LB54J9.mjs} +1 -0
- package/dist/esm/chunks/{Toast-C5XSDgno.mjs → Toast-Bl4s4tRo.mjs} +2 -1
- package/dist/esm/chunks/{UploadArea-Gpq-MhqB.mjs → UploadArea-D3g2g1LK.mjs} +4 -3
- package/dist/esm/chunks/{_types-C2C2Zwd0.mjs → _types-DeEhv4Y5.mjs} +1 -0
- package/dist/esm/components/AudioBubble/index.mjs +1 -1
- package/dist/esm/components/Avatar/index.mjs +1 -1
- package/dist/esm/components/AvatarGroup/index.mjs +2 -2
- package/dist/esm/components/Badge/index.mjs +1 -1
- package/dist/esm/components/Button/index.mjs +5 -5
- package/dist/esm/components/ButtonBar/index.mjs +2 -2
- package/dist/esm/components/Camera/index.mjs +3 -3
- package/dist/esm/components/CheckBox/index.mjs +2 -2
- package/dist/esm/components/Chip/index.mjs +2 -2
- package/dist/esm/components/DivInput/index.mjs +1 -1
- package/dist/esm/components/Dot/index.mjs +1 -1
- package/dist/esm/components/DraggablePanel/index.mjs +1 -1
- package/dist/esm/components/DropDown/index.mjs +2 -2
- package/dist/esm/components/ErrorSummary/index.mjs +1 -1
- package/dist/esm/components/FileIcon/index.mjs +1 -1
- package/dist/esm/components/FileList/index.mjs +4 -4
- package/dist/esm/components/FlexDiv/index.mjs +1 -1
- package/dist/esm/components/Grouper/index.mjs +3 -3
- package/dist/esm/components/Icon/index.mjs +2 -2
- package/dist/esm/components/IconButton/index.mjs +4 -4
- package/dist/esm/components/Label/index.mjs +1 -1
- package/dist/esm/components/Overlay/index.mjs +1 -1
- package/dist/esm/components/Pager/index.mjs +1 -1
- package/dist/esm/components/Progress/index.mjs +2 -2
- package/dist/esm/components/PromptInput/index.mjs +8 -8
- package/dist/esm/components/RadioButton/index.mjs +2 -2
- package/dist/esm/components/RadioButtonList/index.mjs +3 -3
- package/dist/esm/components/Slider/index.mjs +1 -1
- package/dist/esm/components/Spacer/index.mjs +1 -1
- package/dist/esm/components/Switch/index.mjs +1 -1
- package/dist/esm/components/TabBar/index.mjs +5 -5
- package/dist/esm/components/TextArea/index.mjs +6 -6
- package/dist/esm/components/Textfield/index.mjs +7 -7
- package/dist/esm/components/Tip/index.mjs +1 -1
- package/dist/esm/components/Toast/index.mjs +2 -2
- package/dist/esm/components/UploadArea/index.mjs +5 -5
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -0
- package/dist/esm/hooks/useDoubleClick.mjs +1 -0
- package/dist/esm/hooks/useKeyboardShortcuts.mjs +1 -0
- package/dist/esm/hooks/useLastUpdated.mjs +1 -0
- package/dist/esm/hooks/useLocalStore.mjs +1 -0
- package/dist/esm/hooks/useMdStreamBuffer.mjs +1 -0
- package/dist/esm/hooks/useMicrophone.mjs +1 -0
- package/dist/esm/hooks/useObserveResize.mjs +1 -0
- package/dist/esm/hooks/useObserveTheme.mjs +1 -0
- package/dist/esm/hooks/useTheme.mjs +1 -0
- package/dist/esm/hooks/useToolTip.mjs +1 -0
- package/dist/esm/hooks/useTrackRenders.mjs +1 -0
- package/dist/esm/hooks/useWindow.mjs +2 -0
- package/dist/esm/index.mjs +37 -37
- package/dist/esm/providers/ThemeProvider.mjs +12 -9
- package/dist/esm/providers/themeServer.mjs +24 -0
- package/dist/esm/providers.mjs +2 -0
- package/dist/types/components/ButtonBar/_types.d.ts +2 -1
- package/dist/types/components/FlexDiv/FlexDiv.d.ts +2 -0
- package/dist/types/components/FlexDiv/_types.d.ts +77 -0
- package/dist/types/components/FlexDiv/index.d.ts +1 -1
- package/dist/types/components/Icon/_types.d.ts +2 -1
- package/dist/types/components/Icon/iconRegistry.d.ts +1 -1
- package/dist/types/components/IconButton/_types.d.ts +3 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/providers/ThemeProvider.d.ts +1 -0
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/themeServer.d.ts +19 -0
- package/package.json +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { useState, useEffect, useCallback } from "react";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -64,6 +65,7 @@ function useWindow(breakpoints = bootstrapBreakPoints, top = !0) {
|
|
|
64
65
|
}, [ geolocationSupported ]);
|
|
65
66
|
function handleResize() {
|
|
66
67
|
var _a, _b, _c, _d;
|
|
68
|
+
if (!isBrowser) return;
|
|
67
69
|
const windowWidth = top && null !== (_b = null === (_a = window.top) || void 0 === _a ? void 0 : _a.innerWidth) && void 0 !== _b ? _b : window.innerWidth, windowHeight = top && null !== (_d = null === (_c = window.top) || void 0 === _c ? void 0 : _c.innerHeight) && void 0 !== _d ? _d : window.innerHeight;
|
|
68
70
|
setFormFactor(getFormFactor(windowWidth)), setViewportHeight(windowHeight), setViewportWidth(windowWidth),
|
|
69
71
|
isElectron || setHeight(isTouchDevice ? `${windowHeight}px` : "100vh");
|
package/dist/esm/index.mjs
CHANGED
|
@@ -32,79 +32,79 @@ export { useWindow } from "./hooks/useWindow.mjs";
|
|
|
32
32
|
|
|
33
33
|
export { useObserveResize } from "./hooks/useObserveResize.mjs";
|
|
34
34
|
|
|
35
|
-
export { A as AudioBubble } from "./chunks/AudioBubble-
|
|
35
|
+
export { A as AudioBubble } from "./chunks/AudioBubble-DZfzkdlq.mjs";
|
|
36
36
|
|
|
37
|
-
export { A as Avatar } from "./chunks/Avatar-
|
|
37
|
+
export { A as Avatar } from "./chunks/Avatar-m5-zleDk.mjs";
|
|
38
38
|
|
|
39
|
-
export { A as AvatarGroup } from "./chunks/AvatarGroup-
|
|
39
|
+
export { A as AvatarGroup } from "./chunks/AvatarGroup-DlgP4lTS.mjs";
|
|
40
40
|
|
|
41
|
-
export { B as Badge } from "./chunks/Badge-
|
|
41
|
+
export { B as Badge } from "./chunks/Badge-CC0zSLMf.mjs";
|
|
42
42
|
|
|
43
|
-
export { I as IconButton } from "./chunks/IconButton-
|
|
43
|
+
export { I as IconButton } from "./chunks/IconButton-Dciw5CLn.mjs";
|
|
44
44
|
|
|
45
|
-
export { C as Camera } from "./chunks/Camera-
|
|
45
|
+
export { C as Camera } from "./chunks/Camera-BJJpDuuA.mjs";
|
|
46
46
|
|
|
47
|
-
export { C as CheckBox } from "./chunks/CheckBox-
|
|
47
|
+
export { C as CheckBox } from "./chunks/CheckBox-Cf2l3-D9.mjs";
|
|
48
48
|
|
|
49
|
-
export { D as DivInput } from "./chunks/DivInput-
|
|
49
|
+
export { D as DivInput } from "./chunks/DivInput-WJltaCra.mjs";
|
|
50
50
|
|
|
51
|
-
export { D as Dot } from "./chunks/Dot-
|
|
51
|
+
export { D as Dot } from "./chunks/Dot-DZE134mJ.mjs";
|
|
52
52
|
|
|
53
|
-
export { D as DraggablePanel } from "./chunks/DrggablePanel-
|
|
53
|
+
export { D as DraggablePanel } from "./chunks/DrggablePanel-DA7pYWg6.mjs";
|
|
54
54
|
|
|
55
|
-
export { D as DropDown } from "./chunks/DropDown-
|
|
55
|
+
export { D as DropDown } from "./chunks/DropDown-BQ2tNN3_.mjs";
|
|
56
56
|
|
|
57
|
-
export { E as ErrorSummary } from "./chunks/ErrorSummary-
|
|
57
|
+
export { E as ErrorSummary } from "./chunks/ErrorSummary-EzCqVifm.mjs";
|
|
58
58
|
|
|
59
|
-
export { G as Grouper } from "./chunks/Grouper-
|
|
59
|
+
export { G as Grouper } from "./chunks/Grouper-CvPYEsF_.mjs";
|
|
60
60
|
|
|
61
|
-
export { O as Overlay } from "./chunks/Overlay-
|
|
61
|
+
export { O as Overlay } from "./chunks/Overlay-DiSvgIQP.mjs";
|
|
62
62
|
|
|
63
|
-
export { F as FlexDiv, S as Size } from "./chunks/
|
|
63
|
+
export { F as FlexDiv, P as Preset, S as Size } from "./chunks/FlexDiv-BFrVoFhC.mjs";
|
|
64
64
|
|
|
65
|
-
export { P as Pager } from "./chunks/Pager-
|
|
65
|
+
export { P as Pager } from "./chunks/Pager-BoDLaKFh.mjs";
|
|
66
66
|
|
|
67
|
-
export { P as PromptInput } from "./chunks/PromptInput-
|
|
67
|
+
export { P as PromptInput } from "./chunks/PromptInput-plgRiAb7.mjs";
|
|
68
68
|
|
|
69
|
-
export { D as DoneCheck, P as ProgressIndicator } from "./chunks/ProgressIndicator-
|
|
69
|
+
export { D as DoneCheck, P as ProgressIndicator } from "./chunks/ProgressIndicator-CB_oazMD.mjs";
|
|
70
70
|
|
|
71
|
-
export { R as RadioButton } from "./chunks/RadioButton-
|
|
71
|
+
export { R as RadioButton } from "./chunks/RadioButton-B6ImCUYY.mjs";
|
|
72
72
|
|
|
73
|
-
export { R as RadioButtonList } from "./chunks/RadioButtonList-
|
|
73
|
+
export { R as RadioButtonList } from "./chunks/RadioButtonList-Cf6gk8yp.mjs";
|
|
74
74
|
|
|
75
|
-
export { S as Slider } from "./chunks/Slider-
|
|
75
|
+
export { S as Slider } from "./chunks/Slider-Cav86rU6.mjs";
|
|
76
76
|
|
|
77
|
-
export { S as Spacer } from "./chunks/Spacer-
|
|
77
|
+
export { S as Spacer } from "./chunks/Spacer-C5651N0N.mjs";
|
|
78
78
|
|
|
79
|
-
export { S as Switch } from "./chunks/Switch-
|
|
79
|
+
export { S as Switch } from "./chunks/Switch-RfA431T4.mjs";
|
|
80
80
|
|
|
81
|
-
export { T as TabBar } from "./chunks/TabBar-
|
|
81
|
+
export { T as TabBar } from "./chunks/TabBar-0zpJ9GtN.mjs";
|
|
82
82
|
|
|
83
|
-
export { T as TextArea } from "./chunks/TextArea-
|
|
83
|
+
export { T as TextArea } from "./chunks/TextArea-B64bIPHm.mjs";
|
|
84
84
|
|
|
85
|
-
export { T as TextField } from "./chunks/TextField-
|
|
85
|
+
export { T as TextField } from "./chunks/TextField-BZeoN_ye.mjs";
|
|
86
86
|
|
|
87
87
|
export { ThemeProvider } from "./providers/ThemeProvider.mjs";
|
|
88
88
|
|
|
89
|
-
export { T as Tip } from "./chunks/Tip-
|
|
89
|
+
export { T as Tip } from "./chunks/Tip-C5LB54J9.mjs";
|
|
90
90
|
|
|
91
|
-
export { T as Toast, a as ToastType } from "./chunks/Toast-
|
|
91
|
+
export { T as Toast, a as ToastType } from "./chunks/Toast-Bl4s4tRo.mjs";
|
|
92
92
|
|
|
93
|
-
export { B as Button } from "./chunks/Button-
|
|
93
|
+
export { B as Button } from "./chunks/Button-YER9dCLE.mjs";
|
|
94
94
|
|
|
95
|
-
export { C as Chip } from "./chunks/Chip-
|
|
95
|
+
export { C as Chip } from "./chunks/Chip-DWp7p2BF.mjs";
|
|
96
96
|
|
|
97
|
-
export { F as FileIcon, a as FileIconNames } from "./chunks/FileIcon-
|
|
97
|
+
export { F as FileIcon, a as FileIconNames } from "./chunks/FileIcon-Cufsp1gn.mjs";
|
|
98
98
|
|
|
99
|
-
export { I as Icon } from "./chunks/Icon-
|
|
99
|
+
export { I as Icon } from "./chunks/Icon-DI32kOA1.mjs";
|
|
100
100
|
|
|
101
|
-
export { S as SliceIcons } from "./chunks/_types-
|
|
101
|
+
export { S as SliceIcons } from "./chunks/_types-DeEhv4Y5.mjs";
|
|
102
102
|
|
|
103
|
-
export { B as ButtonBar } from "./chunks/ButtonBar-
|
|
103
|
+
export { B as ButtonBar } from "./chunks/ButtonBar-BH4pcEpN.mjs";
|
|
104
104
|
|
|
105
|
-
export { L as Label, a as LabelBackground } from "./chunks/Label-
|
|
105
|
+
export { L as Label, a as LabelBackground } from "./chunks/Label-CvCDAg1y.mjs";
|
|
106
106
|
|
|
107
|
-
export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "./chunks/UploadArea-
|
|
107
|
+
export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "./chunks/UploadArea-D3g2g1LK.mjs";
|
|
108
108
|
|
|
109
109
|
import "./theme/corners.mjs";
|
|
110
110
|
|
|
@@ -128,6 +128,6 @@ import "./chunks/misc-BeEWwOaJ.mjs";
|
|
|
128
128
|
|
|
129
129
|
import "motion/react";
|
|
130
130
|
|
|
131
|
-
import "./chunks/FileList-
|
|
131
|
+
import "./chunks/FileList-BQ9X5YnB.mjs";
|
|
132
132
|
|
|
133
133
|
import "./chunks/debounce-Bst1jxMS.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
|
|
3
4
|
import { useEffect } from "react";
|
|
@@ -26,21 +27,21 @@ styleInject("/* Keep these values in sync with src/hooks/useWindow/useWindow.ts
|
|
|
26
27
|
|
|
27
28
|
styleInject("[data-slice-theme-scope] {\n\t--motion-magnet: cubic-bezier(0.352, 0.003, 0.993, -0.052);\n\t--motion-water: cubic-bezier(0.36, 0, 0.64, 1);\n\t--motion-spring: linear(\n\t\t0,\n\t\t0.002 0.2%,\n\t\t0.011 0.5%,\n\t\t0.041 1%,\n\t\t0.1 1.6%,\n\t\t0.18 2.2%,\n\t\t0.365 3.3%,\n\t\t0.925 6.2%,\n\t\t1.058 7%,\n\t\t1.17 7.8%,\n\t\t1.26 8.6%,\n\t\t1.318 9.3%,\n\t\t1.342 9.7%,\n\t\t1.36 10.1%,\n\t\t1.372 10.5%,\n\t\t1.378 10.9%,\n\t\t1.378 11.4%,\n\t\t1.374 11.7%,\n\t\t1.368 12%,\n\t\t1.348 12.6%,\n\t\t1.314 13.3%,\n\t\t1.237 14.5%,\n\t\t1.026 17.4%,\n\t\t0.975 18.2%,\n\t\t0.933 19%,\n\t\t0.9 19.8%,\n\t\t0.878 20.5%,\n\t\t0.864 21.2%,\n\t\t0.859 21.6%,\n\t\t0.857 22%,\n\t\t0.856 22.5%,\n\t\t0.86 23.1%,\n\t\t0.867 23.7%,\n\t\t0.88 24.4%,\n\t\t0.909 25.6%,\n\t\t0.991 28.6%,\n\t\t1.01 29.4%,\n\t\t1.026 30.2%,\n\t\t1.037 30.9%,\n\t\t1.046 31.6%,\n\t\t1.051 32.3%,\n\t\t1.054 33.1%,\n\t\t1.053 34.2%,\n\t\t1.046 35.5%,\n\t\t1.035 36.7%,\n\t\t1.003 39.8%,\n\t\t0.99 41.4%,\n\t\t0.983 42.8%,\n\t\t0.979 44.2%,\n\t\t0.982 46.3%,\n\t\t1.002 52%,\n\t\t1.006 53.6%,\n\t\t1.008 55.2%,\n\t\t1.007 57.5%,\n\t\t0.999 63.1%,\n\t\t0.997 66.3%,\n\t\t1.001 77.2%,\n\t\t1 88.2%,\n\t\t1\n\t);\n\t--motion-magnet-duration: 0.5s;\n\t--motion-water-duration: 0.25s;\n\t--motion-spring-duration: 1s;\n}\n");
|
|
28
29
|
|
|
29
|
-
styleInject('.slice-global-body {\n\t/* apply themed background color */\n\tbackground-color: var(--core-surface-primary);\n\t/* remove gaps */\n\tmargin: 0;\n\tpadding: 0;\n\t/* base medium body font style with pref. for theme google font */\n\tfont-family: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",\n\t\tRoboto, Helvetica, Arial, sans-serif;\n\tfont-weight: 360;\n\tfont-size: 15px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n\t-webkit-font-smoothing: antialiased;\n}\n');
|
|
30
|
-
|
|
31
|
-
const darkModeMediaQuery = globalThis.matchMedia("(prefers-color-scheme: dark)");
|
|
32
|
-
|
|
33
30
|
function ThemeProvider(props) {
|
|
34
|
-
const {children: children, theme: theme, system: system, global: global} = props;
|
|
31
|
+
const {children: children, theme: theme, system: system, global: global, initialTheme: initialTheme} = props;
|
|
35
32
|
return useEffect(() => {
|
|
36
|
-
if (theme) {
|
|
33
|
+
if (theme || initialTheme) {
|
|
37
34
|
const newTheme = function(theme) {
|
|
38
35
|
if (theme) return theme.includes("dark") ? darkTheme : lightTheme;
|
|
39
|
-
}(theme);
|
|
36
|
+
}(null != theme ? theme : initialTheme);
|
|
40
37
|
if (!newTheme) return;
|
|
41
|
-
document.documentElement.dataset.sliceTheme =
|
|
38
|
+
name = newTheme.name, "undefined" != typeof document && (document.documentElement.dataset.sliceTheme = name);
|
|
42
39
|
}
|
|
43
|
-
|
|
40
|
+
var name;
|
|
41
|
+
}, [ theme, initialTheme ]), useEffect(() => {
|
|
42
|
+
if (!system) return;
|
|
43
|
+
const darkModeMediaQuery = "undefined" == typeof globalThis || "function" != typeof globalThis.matchMedia ? null : globalThis.matchMedia("(prefers-color-scheme: dark)");
|
|
44
|
+
if (!darkModeMediaQuery) return;
|
|
44
45
|
const handleSystemThemeChange = e => {
|
|
45
46
|
if (system) {
|
|
46
47
|
const autoTheme = e.matches ? darkTheme : lightTheme;
|
|
@@ -65,4 +66,6 @@ function ThemeProvider(props) {
|
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
styleInject('.slice-global-body {\n\t/* apply themed background color */\n\tbackground-color: var(--core-surface-primary);\n\t/* remove gaps */\n\tmargin: 0;\n\tpadding: 0;\n\t/* base medium body font style with pref. for theme google font */\n\tfont-family: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",\n\t\tRoboto, Helvetica, Arial, sans-serif;\n\tfont-weight: 360;\n\tfont-size: 15px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n\t-webkit-font-smoothing: antialiased;\n}\n');
|
|
70
|
+
|
|
68
71
|
export { ThemeProvider };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function normalizeThemeName(theme) {
|
|
2
|
+
if (theme) return theme.includes("dark") ? "darkMode" : "lightMode";
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the startup Slice theme from an explicit theme value, cookie value,
|
|
7
|
+
* or fallback theme in that order.
|
|
8
|
+
*/ function resolveInitialTheme(options = {}) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const {theme: theme, cookieTheme: cookieTheme, fallbackTheme: fallbackTheme = "lightMode"} = options;
|
|
11
|
+
return null !== (_b = null !== (_a = normalizeThemeName(theme)) && void 0 !== _a ? _a : normalizeThemeName(cookieTheme)) && void 0 !== _b ? _b : fallbackTheme;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Return the root HTML attributes needed to render the active Slice theme
|
|
16
|
+
* before client hydration.
|
|
17
|
+
*/ function getThemeHtmlAttributes(theme) {
|
|
18
|
+
var _a;
|
|
19
|
+
return {
|
|
20
|
+
"data-slice-theme": null !== (_a = normalizeThemeName(theme)) && void 0 !== _a ? _a : "lightMode"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { getThemeHtmlAttributes, resolveInitialTheme };
|
package/dist/esm/providers.mjs
CHANGED
|
@@ -8,7 +8,7 @@ export type BarButton = {
|
|
|
8
8
|
};
|
|
9
9
|
type ButtonBarBaseProps = {
|
|
10
10
|
buttons?: BarButton[];
|
|
11
|
-
|
|
11
|
+
frameSize?: number;
|
|
12
12
|
iconSize?: number;
|
|
13
13
|
toggle?: boolean;
|
|
14
14
|
selected?: number;
|
|
@@ -23,6 +23,7 @@ type ButtonBarBaseProps = {
|
|
|
23
23
|
bgColorHover?: string;
|
|
24
24
|
bgColorActive?: string;
|
|
25
25
|
labelColor?: string;
|
|
26
|
+
buttonSize?: 's' | 'm' | 'l' | 'xl';
|
|
26
27
|
onClick?: (button: BarButton) => void;
|
|
27
28
|
onChange?: (option: BarButton) => void;
|
|
28
29
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const FlexDiv: React.NamedExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, keyof {
|
|
3
3
|
className?: string;
|
|
4
4
|
children?: any;
|
|
5
|
+
preset?: import("./_types").Preset;
|
|
5
6
|
scrollY?: boolean;
|
|
6
7
|
scrollX?: boolean;
|
|
7
8
|
absolute?: boolean;
|
|
@@ -31,6 +32,7 @@ export declare const FlexDiv: React.NamedExoticComponent<Omit<React.HTMLAttribut
|
|
|
31
32
|
}> & {
|
|
32
33
|
className?: string;
|
|
33
34
|
children?: any;
|
|
35
|
+
preset?: import("./_types").Preset;
|
|
34
36
|
scrollY?: boolean;
|
|
35
37
|
scrollX?: boolean;
|
|
36
38
|
absolute?: boolean;
|
|
@@ -7,9 +7,86 @@ export declare enum Size {
|
|
|
7
7
|
Viewport = "viewport",
|
|
8
8
|
Auto = "auto"
|
|
9
9
|
}
|
|
10
|
+
export declare enum Preset {
|
|
11
|
+
FillScroll = "fill-scroll",
|
|
12
|
+
FillCenter = "fill-center",
|
|
13
|
+
Window = "window",
|
|
14
|
+
Row = "row",
|
|
15
|
+
RowBetween = "row-between",
|
|
16
|
+
Column = "fill-column",
|
|
17
|
+
Default = "default",
|
|
18
|
+
Draggable = "draggable"
|
|
19
|
+
}
|
|
20
|
+
export declare const layoutSets: {
|
|
21
|
+
"fill-scroll": {
|
|
22
|
+
width: string;
|
|
23
|
+
height: string;
|
|
24
|
+
justify: string;
|
|
25
|
+
align: string;
|
|
26
|
+
scrollY: boolean;
|
|
27
|
+
direction: string;
|
|
28
|
+
};
|
|
29
|
+
"fill-center": {
|
|
30
|
+
width: string;
|
|
31
|
+
height: string;
|
|
32
|
+
justify: string;
|
|
33
|
+
align: string;
|
|
34
|
+
scrollY: boolean;
|
|
35
|
+
direction: string;
|
|
36
|
+
};
|
|
37
|
+
window: {
|
|
38
|
+
width: string;
|
|
39
|
+
height: string;
|
|
40
|
+
justify: string;
|
|
41
|
+
align: string;
|
|
42
|
+
scrollY: boolean;
|
|
43
|
+
direction: string;
|
|
44
|
+
};
|
|
45
|
+
row: {
|
|
46
|
+
width: string;
|
|
47
|
+
height: string;
|
|
48
|
+
justify: string;
|
|
49
|
+
align: string;
|
|
50
|
+
scrollY: boolean;
|
|
51
|
+
direction: string;
|
|
52
|
+
};
|
|
53
|
+
"row-between": {
|
|
54
|
+
width: string;
|
|
55
|
+
height: string;
|
|
56
|
+
justify: string;
|
|
57
|
+
align: string;
|
|
58
|
+
scrollY: boolean;
|
|
59
|
+
direction: string;
|
|
60
|
+
};
|
|
61
|
+
"fill-column": {
|
|
62
|
+
width: string;
|
|
63
|
+
height: string;
|
|
64
|
+
justify: string;
|
|
65
|
+
align: string;
|
|
66
|
+
scrollY: boolean;
|
|
67
|
+
direction: string;
|
|
68
|
+
};
|
|
69
|
+
default: {
|
|
70
|
+
width: string;
|
|
71
|
+
height: string;
|
|
72
|
+
justify: string;
|
|
73
|
+
align: string;
|
|
74
|
+
scrollY: boolean;
|
|
75
|
+
direction: string;
|
|
76
|
+
};
|
|
77
|
+
draggable: {
|
|
78
|
+
width: string;
|
|
79
|
+
height: string;
|
|
80
|
+
justify: string;
|
|
81
|
+
align: string;
|
|
82
|
+
scrollY: boolean;
|
|
83
|
+
direction: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
10
86
|
type FlexDivBaseProps = {
|
|
11
87
|
className?: string;
|
|
12
88
|
children?: any;
|
|
89
|
+
preset?: Preset;
|
|
13
90
|
scrollY?: boolean;
|
|
14
91
|
scrollX?: boolean;
|
|
15
92
|
absolute?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { FlexDiv } from './FlexDiv';
|
|
2
|
-
export { Size, type FlexDivProps } from './_types';
|
|
2
|
+
export { Size, Preset, type FlexDivProps } from './_types';
|
|
@@ -4,7 +4,7 @@ type IconBaseProps = {
|
|
|
4
4
|
size?: number;
|
|
5
5
|
stroke?: number;
|
|
6
6
|
strokeColor?: string;
|
|
7
|
-
fillColor?:
|
|
7
|
+
fillColor?: number;
|
|
8
8
|
coverUp?: string;
|
|
9
9
|
toggle?: boolean;
|
|
10
10
|
pointer?: boolean;
|
|
@@ -125,6 +125,7 @@ export declare const SliceIcons: {
|
|
|
125
125
|
readonly home: "home";
|
|
126
126
|
readonly menu: "menu";
|
|
127
127
|
readonly more: "more";
|
|
128
|
+
readonly sidebar: "sidebar";
|
|
128
129
|
readonly x: "x";
|
|
129
130
|
};
|
|
130
131
|
};
|
|
@@ -2,6 +2,7 @@ import type { Transition, Variants } from 'motion/react';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { ToolTip } from '../sharedTypes';
|
|
4
4
|
type IconButtonBaseProps = {
|
|
5
|
+
round?: boolean;
|
|
5
6
|
frameSize?: number;
|
|
6
7
|
iconSize?: number;
|
|
7
8
|
icon?: string;
|
|
@@ -11,7 +12,7 @@ type IconButtonBaseProps = {
|
|
|
11
12
|
tooltip?: string;
|
|
12
13
|
color?: string;
|
|
13
14
|
colorOn?: string;
|
|
14
|
-
fillColor?:
|
|
15
|
+
fillColor?: number;
|
|
15
16
|
disabled?: boolean;
|
|
16
17
|
bgColor?: string;
|
|
17
18
|
bgColorOn?: string;
|
|
@@ -32,6 +33,7 @@ type IconButtonBaseProps = {
|
|
|
32
33
|
borderRadius?: number;
|
|
33
34
|
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
34
35
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
36
|
+
buttonSize?: 's' | 'm' | 'l' | 'xl';
|
|
35
37
|
};
|
|
36
38
|
export type IconButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof IconButtonBaseProps> & IconButtonBaseProps;
|
|
37
39
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export { Grouper } from './components/Grouper';
|
|
|
31
31
|
export type { GrouperProps } from './components/Grouper';
|
|
32
32
|
export { Overlay } from './components/Overlay';
|
|
33
33
|
export type { OverlayProps } from './components/Overlay';
|
|
34
|
-
export { FlexDiv, Size } from './components/FlexDiv';
|
|
34
|
+
export { FlexDiv, Size, Preset } from './components/FlexDiv';
|
|
35
35
|
export type { FlexDivProps } from './components/FlexDiv';
|
|
36
36
|
export { Pager } from './components/Pager';
|
|
37
37
|
export type { PagerProps } from './components/Pager';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type SliceThemeName = 'lightMode' | 'darkMode';
|
|
2
|
+
type ResolveInitialThemeOptions = {
|
|
3
|
+
theme?: string | null;
|
|
4
|
+
cookieTheme?: string | null;
|
|
5
|
+
fallbackTheme?: SliceThemeName;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the startup Slice theme from an explicit theme value, cookie value,
|
|
9
|
+
* or fallback theme in that order.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveInitialTheme(options?: ResolveInitialThemeOptions): SliceThemeName;
|
|
12
|
+
/**
|
|
13
|
+
* Return the root HTML attributes needed to render the active Slice theme
|
|
14
|
+
* before client hydration.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getThemeHtmlAttributes(theme?: string | null): {
|
|
17
|
+
readonly 'data-slice-theme': SliceThemeName;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apple-pie/slice",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -158,6 +158,7 @@
|
|
|
158
158
|
"rollup-plugin-postcss": "^4.0.2",
|
|
159
159
|
"rollup-plugin-strip-code": "^0.2.8",
|
|
160
160
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
161
|
+
"rollup-preserve-directives": "^1.1.3",
|
|
161
162
|
"storybook": "^10.2.9",
|
|
162
163
|
"tsx": "^4.21.0",
|
|
163
164
|
"typescript": "^5.7.3",
|