@apple-pie/slice 0.1.25 → 0.1.28

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.
Files changed (143) hide show
  1. package/dist/cjs/chunks/{AudioBubble-Bqb2Jexf.js → AudioBubble-DisHuKIC.js} +1 -1
  2. package/dist/cjs/chunks/{Button-D3wZtdtj.js → Button-Dic9Rfkr.js} +10 -8
  3. package/dist/cjs/chunks/{ButtonBar-EH8fHFhS.js → ButtonBar-C7tJ6pDM.js} +1 -1
  4. package/dist/cjs/chunks/{Camera-BnsGhOrt.js → Camera-DfnOBHeI.js} +1 -1
  5. package/dist/cjs/chunks/{CheckBox-CEWLxffo.js → CheckBox-Cxzt7DJo.js} +1 -1
  6. package/dist/cjs/chunks/{Chip-BrQgOmJc.js → Chip-DKbhpeho.js} +1 -1
  7. package/dist/cjs/chunks/{DrggablePanel-Duv0nmOm.js → DrggablePanel-DuOxkekq.js} +14 -11
  8. package/dist/cjs/chunks/{DropDown-Bf_pm-Go.js → DropDown-BcRH7Fle.js} +10 -8
  9. package/dist/cjs/chunks/{FileList-DobAcOSH.js → FileList-S0Hf82-C.js} +1 -1
  10. package/dist/cjs/chunks/{FlexDiv-C-3ahI-j.js → FlexDiv-BPnptnPL.js} +60 -20
  11. package/dist/cjs/chunks/{Grouper-D9G8PKoM.js → Grouper-CgkPu4sa.js} +1 -1
  12. package/dist/cjs/chunks/{Icon-fRM3E0N6.js → Icon-UFrKtcYJ.js} +184 -11
  13. package/dist/cjs/chunks/{IconButton-Cf2RBUKA.js → IconButton-CaQ0SioJ.js} +14 -11
  14. package/dist/cjs/chunks/{ProgressIndicator-t-jv4OhI.js → ProgressIndicator-n9CfW6jd.js} +1 -1
  15. package/dist/cjs/chunks/{PromptInput-B1WG22xz.js → PromptInput-CI0iSYKL.js} +1 -1
  16. package/dist/cjs/chunks/{RadioButton-BAIMCshV.js → RadioButton-JBNaNihZ.js} +1 -1
  17. package/dist/cjs/chunks/{RadioButtonList-Bsg5oFaC.js → RadioButtonList-CW2pDNIq.js} +1 -1
  18. package/dist/cjs/chunks/{TabBar-BfyfjmPQ.js → TabBar-Bpngr90Q.js} +1 -1
  19. package/dist/cjs/chunks/{TextArea-CHNWsfWH.js → TextArea-BZgwajEC.js} +1 -1
  20. package/dist/cjs/chunks/{TextField-2xzSdIx3.js → TextField-x1MWESCA.js} +5 -5
  21. package/dist/cjs/chunks/{Tip-DceuNR6k.js → Tip-BZQhRyng.js} +1 -1
  22. package/dist/cjs/chunks/{Toast-C8Hc9ZKI.js → Toast-cda-RInJ.js} +1 -1
  23. package/dist/cjs/chunks/ToggleButton-CuX1nQk4.js +40 -0
  24. package/dist/cjs/chunks/{UploadArea-UFWRQ-nW.js → UploadArea-CiiKnWe7.js} +1 -1
  25. package/dist/cjs/chunks/{_types-VoADvwjb.js → _types-Cqkxw-yc.js} +10 -2
  26. package/dist/cjs/chunks/microphoneStore-CgFohRfy.js +124 -0
  27. package/dist/cjs/components/AudioBubble/index.js +7 -6
  28. package/dist/cjs/components/Button/index.js +7 -6
  29. package/dist/cjs/components/ButtonBar/index.js +7 -6
  30. package/dist/cjs/components/Camera/index.js +8 -7
  31. package/dist/cjs/components/CheckBox/index.js +7 -6
  32. package/dist/cjs/components/Chip/index.js +7 -6
  33. package/dist/cjs/components/DraggablePanel/index.js +7 -6
  34. package/dist/cjs/components/DropDown/index.js +7 -6
  35. package/dist/cjs/components/ErrorSummary/index.js +3 -2
  36. package/dist/cjs/components/FileIcon/index.js +6 -4
  37. package/dist/cjs/components/FileList/index.js +7 -7
  38. package/dist/cjs/components/FlexDiv/index.js +1 -1
  39. package/dist/cjs/components/Grouper/index.js +5 -4
  40. package/dist/cjs/components/Icon/index.js +7 -6
  41. package/dist/cjs/components/IconButton/index.js +6 -5
  42. package/dist/cjs/components/Progress/index.js +4 -4
  43. package/dist/cjs/components/PromptInput/index.js +8 -7
  44. package/dist/cjs/components/RadioButton/index.js +7 -6
  45. package/dist/cjs/components/RadioButtonList/index.js +5 -5
  46. package/dist/cjs/components/TabBar/index.js +8 -7
  47. package/dist/cjs/components/TextArea/index.js +7 -6
  48. package/dist/cjs/components/Textfield/index.js +8 -7
  49. package/dist/cjs/components/Tip/index.js +1 -1
  50. package/dist/cjs/components/Toast/index.js +5 -5
  51. package/dist/cjs/components/ToggleButton/index.js +13 -0
  52. package/dist/cjs/components/UploadArea/index.js +8 -8
  53. package/dist/cjs/hooks/useMicrophone.js +19 -13
  54. package/dist/cjs/hooks/useObserveTheme.js +8 -7
  55. package/dist/cjs/hooks/useTheme.js +25 -15
  56. package/dist/cjs/hooks/useToolTip.js +20 -5
  57. package/dist/cjs/hooks.js +4 -3
  58. package/dist/cjs/index.js +5 -5
  59. package/dist/cjs/providers/ThemeProvider.js +60 -24
  60. package/dist/cjs/stores/microphone.js +12 -0
  61. package/dist/cjs/stores.js +9 -2
  62. package/dist/cjs/theme/colors.js +2 -2
  63. package/dist/esm/chunks/{AudioBubble-DZfzkdlq.mjs → AudioBubble-D052QyPH.mjs} +1 -1
  64. package/dist/esm/chunks/{Button-YER9dCLE.mjs → Button-BIbAGVV8.mjs} +11 -9
  65. package/dist/esm/chunks/{ButtonBar-BH4pcEpN.mjs → ButtonBar-B-1YFX9u.mjs} +1 -1
  66. package/dist/esm/chunks/{Camera-BJJpDuuA.mjs → Camera-BQBo2g52.mjs} +1 -1
  67. package/dist/esm/chunks/{CheckBox-Cf2l3-D9.mjs → CheckBox-DDwE1wkX.mjs} +1 -1
  68. package/dist/esm/chunks/{Chip-DWp7p2BF.mjs → Chip-BuHc883v.mjs} +1 -1
  69. package/dist/esm/chunks/{DrggablePanel-DA7pYWg6.mjs → DrggablePanel-Dc6lqqfO.mjs} +14 -11
  70. package/dist/esm/chunks/{DropDown-BQ2tNN3_.mjs → DropDown-CdkEVTRk.mjs} +10 -8
  71. package/dist/esm/chunks/{FileList-BQ9X5YnB.mjs → FileList-DN4Ubroe.mjs} +2 -2
  72. package/dist/esm/chunks/{FlexDiv-BFrVoFhC.mjs → FlexDiv-BWZ7f8mA.mjs} +61 -21
  73. package/dist/esm/chunks/{Grouper-CvPYEsF_.mjs → Grouper-C4A3qYot.mjs} +1 -1
  74. package/dist/esm/chunks/{Icon-DI32kOA1.mjs → Icon-DRzjkybv.mjs} +185 -12
  75. package/dist/esm/chunks/{IconButton-Dciw5CLn.mjs → IconButton-b1v9Me0P.mjs} +14 -11
  76. package/dist/esm/chunks/{ProgressIndicator-CB_oazMD.mjs → ProgressIndicator-D5e7406q.mjs} +1 -1
  77. package/dist/esm/chunks/{PromptInput-plgRiAb7.mjs → PromptInput-Dmx4sQZ3.mjs} +3 -3
  78. package/dist/esm/chunks/{RadioButton-B6ImCUYY.mjs → RadioButton-D2T-SsVw.mjs} +1 -1
  79. package/dist/esm/chunks/{RadioButtonList-Cf6gk8yp.mjs → RadioButtonList-BSPuAYoh.mjs} +1 -1
  80. package/dist/esm/chunks/{TabBar-0zpJ9GtN.mjs → TabBar-DBoZ8aoV.mjs} +2 -2
  81. package/dist/esm/chunks/{TextArea-B64bIPHm.mjs → TextArea-CSUDfcYd.mjs} +1 -1
  82. package/dist/esm/chunks/{TextField-BZeoN_ye.mjs → TextField-Z1O858hB.mjs} +7 -7
  83. package/dist/esm/chunks/{Tip-C5LB54J9.mjs → Tip-B8YrmJEt.mjs} +1 -1
  84. package/dist/esm/chunks/{Toast-Bl4s4tRo.mjs → Toast-QQ6GMr5F.mjs} +1 -1
  85. package/dist/esm/chunks/ToggleButton-B5oobnXJ.mjs +51 -0
  86. package/dist/esm/chunks/{UploadArea-D3g2g1LK.mjs → UploadArea-CJAQmqOS.mjs} +4 -4
  87. package/dist/esm/chunks/{_types-DeEhv4Y5.mjs → _types-fSW-DudT.mjs} +10 -2
  88. package/dist/esm/chunks/microphoneStore-t16oxjGB.mjs +121 -0
  89. package/dist/esm/components/AudioBubble/index.mjs +5 -3
  90. package/dist/esm/components/Button/index.mjs +5 -3
  91. package/dist/esm/components/ButtonBar/index.mjs +6 -4
  92. package/dist/esm/components/Camera/index.mjs +6 -4
  93. package/dist/esm/components/CheckBox/index.mjs +6 -4
  94. package/dist/esm/components/Chip/index.mjs +6 -4
  95. package/dist/esm/components/DraggablePanel/index.mjs +5 -3
  96. package/dist/esm/components/DropDown/index.mjs +6 -4
  97. package/dist/esm/components/ErrorSummary/index.mjs +4 -2
  98. package/dist/esm/components/FileIcon/index.mjs +4 -0
  99. package/dist/esm/components/FileList/index.mjs +7 -5
  100. package/dist/esm/components/FlexDiv/index.mjs +1 -1
  101. package/dist/esm/components/Grouper/index.mjs +6 -4
  102. package/dist/esm/components/Icon/index.mjs +6 -4
  103. package/dist/esm/components/IconButton/index.mjs +4 -2
  104. package/dist/esm/components/Progress/index.mjs +6 -4
  105. package/dist/esm/components/PromptInput/index.mjs +9 -7
  106. package/dist/esm/components/RadioButton/index.mjs +6 -4
  107. package/dist/esm/components/RadioButtonList/index.mjs +7 -5
  108. package/dist/esm/components/TabBar/index.mjs +7 -5
  109. package/dist/esm/components/TextArea/index.mjs +6 -4
  110. package/dist/esm/components/Textfield/index.mjs +9 -7
  111. package/dist/esm/components/Tip/index.mjs +1 -1
  112. package/dist/esm/components/Toast/index.mjs +6 -4
  113. package/dist/esm/components/ToggleButton/index.mjs +45 -0
  114. package/dist/esm/components/UploadArea/index.mjs +10 -8
  115. package/dist/esm/hooks/useMicrophone.mjs +19 -13
  116. package/dist/esm/hooks/useObserveTheme.mjs +10 -4
  117. package/dist/esm/hooks/useTheme.mjs +27 -10
  118. package/dist/esm/hooks/useToolTip.mjs +21 -6
  119. package/dist/esm/hooks.mjs +6 -0
  120. package/dist/esm/index.mjs +26 -24
  121. package/dist/esm/providers/ThemeProvider.mjs +65 -28
  122. package/dist/esm/stores/microphone.mjs +7 -0
  123. package/dist/esm/stores.mjs +2 -0
  124. package/dist/esm/theme/colors.mjs +2 -2
  125. package/dist/types/components/Button/Button.d.ts +2 -0
  126. package/dist/types/components/Button/_types.d.ts +1 -0
  127. package/dist/types/components/DraggablePanel/DrggablePanel.d.ts +1 -2
  128. package/dist/types/components/FlexDiv/FlexDiv.d.ts +2 -0
  129. package/dist/types/components/FlexDiv/_types.d.ts +35 -7
  130. package/dist/types/components/Icon/_types.d.ts +9 -0
  131. package/dist/types/components/IconButton/_types.d.ts +1 -0
  132. package/dist/types/components/ToggleButton/ToggleButton.d.ts +2 -0
  133. package/dist/types/components/ToggleButton/_types.d.ts +24 -0
  134. package/dist/types/components/ToggleButton/index.d.ts +2 -0
  135. package/dist/types/hooks/useMicrophone/useMicrophone.d.ts +2 -1
  136. package/dist/types/hooks/useTheme/useTheme.d.ts +5 -1
  137. package/dist/types/index.d.ts +2 -0
  138. package/dist/types/providers/ThemeProvider.d.ts +6 -0
  139. package/dist/types/stores/index.d.ts +1 -0
  140. package/dist/types/stores/microphone/_types.d.ts +28 -0
  141. package/dist/types/stores/microphone/index.d.ts +2 -0
  142. package/dist/types/stores/microphone/microphoneStore.d.ts +24 -0
  143. package/package.json +1 -1
@@ -10,6 +10,7 @@ export declare const Button: React.NamedExoticComponent<Omit<React.ButtonHTMLAtt
10
10
  label?: string;
11
11
  iconRight?: string;
12
12
  iconLeft?: string;
13
+ iconFill?: boolean;
13
14
  fill?: boolean;
14
15
  count?: number;
15
16
  showDot?: boolean;
@@ -48,6 +49,7 @@ export declare const Button: React.NamedExoticComponent<Omit<React.ButtonHTMLAtt
48
49
  label?: string;
49
50
  iconRight?: string;
50
51
  iconLeft?: string;
52
+ iconFill?: boolean;
51
53
  fill?: boolean;
52
54
  count?: number;
53
55
  showDot?: boolean;
@@ -10,6 +10,7 @@ type ButtonBaseProps = {
10
10
  label?: string;
11
11
  iconRight?: string;
12
12
  iconLeft?: string;
13
+ iconFill?: boolean;
13
14
  fill?: boolean;
14
15
  count?: number;
15
16
  showDot?: boolean;
@@ -18,13 +18,12 @@ type DraggablePanelBaseProps = {
18
18
  onResizeStart?: (info: Info) => void;
19
19
  containerRef?: React.RefObject<HTMLDivElement | null>;
20
20
  sizeConstraints?: Constraint;
21
- dragsRight?: boolean;
22
21
  isClosed?: boolean;
23
22
  resizeHandle?: Partial<ResizeHandle>;
24
23
  borderRight?: any;
25
24
  borderLeft?: any;
26
25
  bgColor?: string;
27
- drags?: boolean;
26
+ drags?: 'left' | 'right' | false;
28
27
  dragHandle?: boolean;
29
28
  dragHandleStyle?: DragHandleProps;
30
29
  disableOnContext?: boolean;
@@ -3,6 +3,7 @@ export declare const FlexDiv: React.NamedExoticComponent<Omit<React.HTMLAttribut
3
3
  className?: string;
4
4
  children?: any;
5
5
  preset?: import("./_types").Preset;
6
+ scrollBox?: boolean;
6
7
  scrollY?: boolean;
7
8
  scrollX?: boolean;
8
9
  absolute?: boolean;
@@ -33,6 +34,7 @@ export declare const FlexDiv: React.NamedExoticComponent<Omit<React.HTMLAttribut
33
34
  className?: string;
34
35
  children?: any;
35
36
  preset?: import("./_types").Preset;
37
+ scrollBox?: boolean;
36
38
  scrollY?: boolean;
37
39
  scrollX?: boolean;
38
40
  absolute?: boolean;
@@ -10,10 +10,11 @@ export declare enum Size {
10
10
  export declare enum Preset {
11
11
  FillScroll = "fill-scroll",
12
12
  FillCenter = "fill-center",
13
+ FillStart = "fill-start",
13
14
  Window = "window",
14
15
  Row = "row",
15
16
  RowBetween = "row-between",
16
- Column = "fill-column",
17
+ Column = "column",
17
18
  Default = "default",
18
19
  Draggable = "draggable"
19
20
  }
@@ -24,6 +25,8 @@ export declare const layoutSets: {
24
25
  justify: string;
25
26
  align: string;
26
27
  scrollY: boolean;
28
+ scrollX: boolean;
29
+ overflow: string;
27
30
  direction: string;
28
31
  };
29
32
  "fill-center": {
@@ -32,6 +35,18 @@ export declare const layoutSets: {
32
35
  justify: string;
33
36
  align: string;
34
37
  scrollY: boolean;
38
+ scrollX: boolean;
39
+ overflow: string;
40
+ direction: string;
41
+ };
42
+ "fill-start": {
43
+ width: string;
44
+ height: string;
45
+ justify: string;
46
+ align: string;
47
+ scrollY: boolean;
48
+ scrollX: boolean;
49
+ overflow: string;
35
50
  direction: string;
36
51
  };
37
52
  window: {
@@ -40,6 +55,8 @@ export declare const layoutSets: {
40
55
  justify: string;
41
56
  align: string;
42
57
  scrollY: boolean;
58
+ scrollX: boolean;
59
+ overflow: string;
43
60
  direction: string;
44
61
  };
45
62
  row: {
@@ -47,7 +64,9 @@ export declare const layoutSets: {
47
64
  height: string;
48
65
  justify: string;
49
66
  align: string;
50
- scrollY: boolean;
67
+ scrollY: undefined;
68
+ scrollX: undefined;
69
+ overflow: string;
51
70
  direction: string;
52
71
  };
53
72
  "row-between": {
@@ -55,15 +74,19 @@ export declare const layoutSets: {
55
74
  height: string;
56
75
  justify: string;
57
76
  align: string;
58
- scrollY: boolean;
77
+ scrollY: undefined;
78
+ scrollX: undefined;
79
+ overflow: string;
59
80
  direction: string;
60
81
  };
61
- "fill-column": {
82
+ column: {
62
83
  width: string;
63
84
  height: string;
64
85
  justify: string;
65
86
  align: string;
66
- scrollY: boolean;
87
+ scrollY: undefined;
88
+ scrollX: undefined;
89
+ overflow: string;
67
90
  direction: string;
68
91
  };
69
92
  default: {
@@ -71,7 +94,9 @@ export declare const layoutSets: {
71
94
  height: string;
72
95
  justify: string;
73
96
  align: string;
74
- scrollY: boolean;
97
+ scrollY: undefined;
98
+ scrollX: undefined;
99
+ overflow: string;
75
100
  direction: string;
76
101
  };
77
102
  draggable: {
@@ -79,7 +104,9 @@ export declare const layoutSets: {
79
104
  height: string;
80
105
  justify: string;
81
106
  align: string;
82
- scrollY: boolean;
107
+ scrollY: undefined;
108
+ scrollX: undefined;
109
+ overflow: string;
83
110
  direction: string;
84
111
  };
85
112
  };
@@ -87,6 +114,7 @@ type FlexDivBaseProps = {
87
114
  className?: string;
88
115
  children?: any;
89
116
  preset?: Preset;
117
+ scrollBox?: boolean;
90
118
  scrollY?: boolean;
91
119
  scrollX?: boolean;
92
120
  absolute?: boolean;
@@ -9,6 +9,7 @@ type IconBaseProps = {
9
9
  toggle?: boolean;
10
10
  pointer?: boolean;
11
11
  disabled?: boolean;
12
+ fill?: boolean;
12
13
  onClick?: (e: React.MouseEvent<SVGElement, MouseEvent>) => void;
13
14
  };
14
15
  export type IconProps = Omit<React.SVGAttributes<SVGSVGElement>, keyof IconBaseProps> & IconBaseProps;
@@ -52,6 +53,8 @@ export declare const SliceIcons: {
52
53
  readonly videoOff: "video off";
53
54
  readonly download: "download";
54
55
  readonly upload: "upload";
56
+ readonly speaker: "speaker";
57
+ readonly speakerMuted: "speaker muted";
55
58
  };
56
59
  readonly files: {
57
60
  readonly document: "document";
@@ -68,6 +71,7 @@ export declare const SliceIcons: {
68
71
  readonly invoice: "invoice";
69
72
  readonly payment: "payment";
70
73
  readonly wallet: "wallet";
74
+ readonly laptop: "laptop";
71
75
  };
72
76
  readonly charts: {
73
77
  readonly barChart: "bar chart";
@@ -107,6 +111,10 @@ export declare const SliceIcons: {
107
111
  readonly fontSmaller: "font smaller";
108
112
  readonly characterBeam: "character beam";
109
113
  };
114
+ readonly weather: {
115
+ readonly sun: "sun";
116
+ readonly moonFull: "moon full";
117
+ };
110
118
  readonly ai: {
111
119
  readonly sparkle: "sparkle";
112
120
  readonly wand: "wand";
@@ -126,6 +134,7 @@ export declare const SliceIcons: {
126
134
  readonly menu: "menu";
127
135
  readonly more: "more";
128
136
  readonly sidebar: "sidebar";
137
+ readonly keyboard: "keyboard";
129
138
  readonly x: "x";
130
139
  };
131
140
  };
@@ -5,6 +5,7 @@ type IconButtonBaseProps = {
5
5
  round?: boolean;
6
6
  frameSize?: number;
7
7
  iconSize?: number;
8
+ iconFill?: boolean;
8
9
  icon?: string;
9
10
  iconColor?: string;
10
11
  iconColorOn?: string;
@@ -0,0 +1,2 @@
1
+ import type { ToggleButtonProps } from './_types';
2
+ export declare function ToggleButton(props: Readonly<ToggleButtonProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import type React from 'react';
2
+ import type { ToolTip } from '../sharedTypes';
3
+ export interface ToggleButtonProps {
4
+ children?: React.ReactNode;
5
+ label?: string;
6
+ textSize?: 's' | 'm' | 'l';
7
+ buttonSize?: 's' | 'm' | 'l' | 'xl';
8
+ frameSize?: number;
9
+ icon?: string;
10
+ selected?: boolean;
11
+ iconColor?: string;
12
+ iconColorOn?: string;
13
+ bgColor?: string;
14
+ bgColorOn?: string;
15
+ onChange?: (state: boolean) => void;
16
+ onSelect?: () => void;
17
+ onToolTip?: (tip: ToolTip | null) => void;
18
+ gap?: number;
19
+ iconSize?: number;
20
+ tooltip?: string;
21
+ fill?: boolean;
22
+ unselect?: boolean;
23
+ disabled?: boolean;
24
+ }
@@ -0,0 +1,2 @@
1
+ export { ToggleButton } from './ToggleButton';
2
+ export type { ToggleButtonProps } from './_types';
@@ -6,6 +6,7 @@ export type MicOption = {
6
6
  export type UseMicrophoneReturn = {
7
7
  micStream: RefObject<MediaStream | null>;
8
8
  micTrack: RefObject<MediaStreamTrack | null>;
9
+ isActive: boolean;
9
10
  muted: boolean;
10
11
  isSupported: boolean;
11
12
  isRequesting: boolean;
@@ -20,4 +21,4 @@ export type UseMicrophoneReturn = {
20
21
  refreshMicrophones: () => Promise<MediaDeviceInfo[]>;
21
22
  setMicrophone: (deviceId: string | DropDownOption<MicOption>) => Promise<void>;
22
23
  };
23
- export declare function useMicrophone(startMuted?: boolean, microphoneDeviceId?: string): UseMicrophoneReturn;
24
+ export declare function useMicrophone(startMuted?: boolean, microphoneDeviceId?: string, autoRequest?: boolean): UseMicrophoneReturn;
@@ -37,11 +37,15 @@ export declare function useTheme(): {
37
37
  */
38
38
  set: (newTheme: SliceTheme | string) => void;
39
39
  /**
40
- * Toggle between light and dark themes
40
+ * Togglebetween light and dark themes
41
41
  */
42
42
  toggle: () => void;
43
43
  /**
44
44
  * If the currently active theme is the Slice's default dark theme'
45
45
  */
46
46
  isDark: boolean;
47
+ /**
48
+ * True when the current theme is still being derived from the OS preference
49
+ */
50
+ systemTheme: boolean;
47
51
  };
@@ -48,6 +48,8 @@ export type { SliderProps } from './components/Slider';
48
48
  export { Spacer } from './components/Spacer';
49
49
  export { Switch } from './components/Switch';
50
50
  export type { SwitchProps } from './components/Switch';
51
+ export { ToggleButton } from './components/ToggleButton';
52
+ export type { ToggleButtonProps } from './components/ToggleButton';
51
53
  export { TabBar } from './components/TabBar';
52
54
  export type { TabOption, TabBarProps } from './components/TabBar';
53
55
  export { TextArea } from './components/TextArea';
@@ -12,5 +12,11 @@ interface ThemeProviderProps {
12
12
  system?: boolean;
13
13
  global?: boolean;
14
14
  }
15
+ type ThemeContextValue = {
16
+ initialTheme: string;
17
+ systemTheme: boolean;
18
+ setSystemTheme: (value: boolean) => void;
19
+ };
20
+ export declare function useThemeContext(): ThemeContextValue;
15
21
  export declare function ThemeProvider(props: Readonly<ThemeProviderProps>): import("react/jsx-runtime").JSX.Element;
16
22
  export {};
@@ -1,4 +1,5 @@
1
1
  export * from './LocalDB';
2
+ export * from './microphone';
2
3
  export * from './SSE';
3
4
  export * from './toast';
4
5
  export * from './tip';
@@ -0,0 +1,28 @@
1
+ import type { RefObject } from 'react';
2
+ import type { DropDownOption } from '../../components/DropDown';
3
+ import type { MicOption, UseMicrophoneReturn } from '../../hooks';
4
+ export type MicrophoneStoreState = {
5
+ micStream: RefObject<MediaStream | null>;
6
+ micTrack: RefObject<MediaStreamTrack | null>;
7
+ isActive: boolean;
8
+ muted: boolean;
9
+ isSupported: boolean;
10
+ isRequesting: boolean;
11
+ error: Error | null;
12
+ microphones: MediaDeviceInfo[];
13
+ micOptions: DropDownOption<MicOption>[];
14
+ };
15
+ export type MicrophoneStoreActions = {
16
+ sync: (microphone: UseMicrophoneReturn | null) => void;
17
+ clear: () => void;
18
+ requestMicrophone: () => Promise<MediaStream | null>;
19
+ stopMicrophone: () => void;
20
+ muteMic: () => boolean;
21
+ unmuteMic: () => boolean;
22
+ toggleMute: () => void;
23
+ refreshMicrophones: () => Promise<MediaDeviceInfo[]>;
24
+ setMicrophone: (deviceId: string | DropDownOption<MicOption>) => Promise<void>;
25
+ };
26
+ export type MicrophoneStore = MicrophoneStoreState & {
27
+ actions: MicrophoneStoreActions;
28
+ };
@@ -0,0 +1,2 @@
1
+ export { useMicrophoneStore, useSyncMicrophoneStore, useMicStream, useMicTrack, useMicActive, useMicMuted, useMicSupported, useMicRequesting, useMicError, useMicrophones, useMicOptions, useMicrophoneStoreActions, microphoneActions, getMicrophoneState, } from './microphoneStore';
2
+ export type { MicrophoneStore, MicrophoneStoreActions, MicrophoneStoreState, } from './_types';
@@ -0,0 +1,24 @@
1
+ import type { RefObject } from 'react';
2
+ import type { DropDownOption } from '../../components/DropDown';
3
+ import type { MicOption, UseMicrophoneReturn } from '../../hooks';
4
+ import type { MicrophoneStore, MicrophoneStoreActions } from './_types';
5
+ /**
6
+ * Store factory that creates the store state based on a sync or a clear
7
+ */
8
+ export declare const useMicrophoneStore: import("zustand").UseBoundStore<import("zustand").StoreApi<MicrophoneStore>>;
9
+ /**
10
+ * Bind the value of useMicrophone hook to the useMicrophoneStore. Use this to update the store with a new mic object.
11
+ */
12
+ export declare function useSyncMicrophoneStore(microphone: UseMicrophoneReturn | null): void;
13
+ export declare const useMicStream: () => RefObject<MediaStream | null>;
14
+ export declare const useMicTrack: () => RefObject<MediaStreamTrack | null>;
15
+ export declare const useMicActive: () => boolean;
16
+ export declare const useMicMuted: () => boolean;
17
+ export declare const useMicSupported: () => boolean;
18
+ export declare const useMicRequesting: () => boolean;
19
+ export declare const useMicError: () => Error | null;
20
+ export declare const useMicrophones: () => MediaDeviceInfo[];
21
+ export declare const useMicOptions: () => DropDownOption<MicOption>[];
22
+ export declare const useMicrophoneStoreActions: () => MicrophoneStoreActions;
23
+ export declare const microphoneActions: MicrophoneStoreActions;
24
+ export declare const getMicrophoneState: () => MicrophoneStore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apple-pie/slice",
3
- "version": "0.1.25",
3
+ "version": "0.1.28",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {