mac-human-design 0.1.2 → 0.1.5

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.
@@ -0,0 +1,428 @@
1
+ import * as React from "react";
2
+ import {
3
+ MacAccordion,
4
+ MacAlertDialog,
5
+ MacAutocomplete,
6
+ MacAvatar,
7
+ MacButton,
8
+ MacCheckbox,
9
+ MacCheckboxGroup,
10
+ MacCollapsible,
11
+ MacCombobox,
12
+ MacContextMenu,
13
+ MacCSPProvider,
14
+ MacDestructiveButton,
15
+ MacDialog,
16
+ MacDirectionProvider,
17
+ MacDrawer,
18
+ MacField,
19
+ MacFieldset,
20
+ MacForm,
21
+ MacHelpButton,
22
+ MacIconButton,
23
+ MacInput,
24
+ MacMenu,
25
+ MacMenubar,
26
+ MacMeter,
27
+ MacNavigationMenu,
28
+ MacNumberField,
29
+ MacOTPField,
30
+ MacPlainButton,
31
+ MacPopover,
32
+ MacPreviewCard,
33
+ MacPrimaryButton,
34
+ MacProgress,
35
+ MacRadio,
36
+ MacRadioGroup,
37
+ MacScrollArea,
38
+ MacSearchField,
39
+ MacSecondaryButton,
40
+ MacSeparatedSegmentedToggleGroup,
41
+ MacSegmentedToggleGroup,
42
+ MacSelect,
43
+ MacSeparator,
44
+ MacSlider,
45
+ MacSwitch,
46
+ MacTabs,
47
+ MacTextField,
48
+ MacToast,
49
+ MacToggle,
50
+ MacToggleGroup,
51
+ MacToolbar,
52
+ MacToolbarToggle,
53
+ MacTooltip,
54
+ } from "./MacBaseUI";
55
+ import { MacSegmentedControl } from "./MacSegmentedControl";
56
+
57
+ const choices = [
58
+ { label: "General", value: "general" },
59
+ { label: "Display", value: "display" },
60
+ { label: "Advanced", value: "advanced" },
61
+ ];
62
+
63
+ function GallerySection({ title, children }: { title: string; children: React.ReactNode }) {
64
+ return (
65
+ <section className="hd-mac-gallery-section">
66
+ <h2>{title}</h2>
67
+ <div className="hd-mac-gallery-row">{children}</div>
68
+ </section>
69
+ );
70
+ }
71
+
72
+ export function MacBaseUIGallery() {
73
+ const [segment, setSegment] = React.useState("general");
74
+ const [toggleValue, setToggleValue] = React.useState<readonly string[]>(["one"]);
75
+
76
+ return (
77
+ <MacCSPProvider>
78
+ <MacDirectionProvider direction="ltr">
79
+ <div className="hd-mac hd-mac-gallery">
80
+ <GallerySection title="Buttons">
81
+ <MacButton>Default</MacButton>
82
+ <MacPrimaryButton>Continue</MacPrimaryButton>
83
+ <MacSecondaryButton>Options</MacSecondaryButton>
84
+ <MacDestructiveButton>Delete</MacDestructiveButton>
85
+ <MacPlainButton>Cancel</MacPlainButton>
86
+ <MacIconButton aria-label="Add">+</MacIconButton>
87
+ <MacHelpButton aria-label="Help">?</MacHelpButton>
88
+ </GallerySection>
89
+
90
+ <GallerySection title="Segmented Controls">
91
+ <MacSegmentedControl
92
+ options={choices}
93
+ value={segment}
94
+ onChange={setSegment}
95
+ />
96
+ <MacSegmentedToggleGroup defaultValue={["compact"]}>
97
+ <MacToggle value="compact">Compact</MacToggle>
98
+ <MacToggle value="expanded">Expanded</MacToggle>
99
+ </MacSegmentedToggleGroup>
100
+ <MacToggleGroup value={toggleValue} onValueChange={setToggleValue}>
101
+ <MacToggle value="one">One</MacToggle>
102
+ <MacToggle value="two">Two</MacToggle>
103
+ </MacToggleGroup>
104
+ <MacSeparatedSegmentedToggleGroup defaultValue={["left"]}>
105
+ <MacToggle value="left">Left</MacToggle>
106
+ <MacToggle value="center">Center</MacToggle>
107
+ <MacToggle value="right">Right</MacToggle>
108
+ </MacSeparatedSegmentedToggleGroup>
109
+ </GallerySection>
110
+
111
+ <GallerySection title="Fields">
112
+ <MacForm>
113
+ <MacField.Root>
114
+ <MacField.Label>Name</MacField.Label>
115
+ <MacInput placeholder="Untitled" />
116
+ <MacField.Description>Shown in the window title.</MacField.Description>
117
+ </MacField.Root>
118
+ <MacField.Root>
119
+ <MacField.Label>Text Field</MacField.Label>
120
+ <MacTextField placeholder="Editable text" />
121
+ </MacField.Root>
122
+ <MacField.Root>
123
+ <MacField.Label>Search</MacField.Label>
124
+ <MacSearchField placeholder="Search settings" />
125
+ </MacField.Root>
126
+ <MacFieldset.Root>
127
+ <MacFieldset.Legend>Options</MacFieldset.Legend>
128
+ <MacCheckboxGroup>
129
+ <label className="hd-mac-gallery-inline-choice">
130
+ <MacCheckbox.Root defaultChecked>
131
+ <MacCheckbox.Indicator />
132
+ </MacCheckbox.Root>
133
+ Launch at login
134
+ </label>
135
+ </MacCheckboxGroup>
136
+ <MacRadioGroup defaultValue="auto">
137
+ <label className="hd-mac-gallery-inline-choice">
138
+ <MacRadio.Root value="auto">
139
+ <MacRadio.Indicator />
140
+ </MacRadio.Root>
141
+ Automatic
142
+ </label>
143
+ </MacRadioGroup>
144
+ </MacFieldset.Root>
145
+ </MacForm>
146
+ </GallerySection>
147
+
148
+ <GallerySection title="Inputs">
149
+ <MacNumberField.Root defaultValue={12}>
150
+ <MacNumberField.Group>
151
+ <MacNumberField.Decrement>-</MacNumberField.Decrement>
152
+ <MacNumberField.Input />
153
+ <MacNumberField.Increment>+</MacNumberField.Increment>
154
+ </MacNumberField.Group>
155
+ </MacNumberField.Root>
156
+ <MacOTPField.Root length={2}>
157
+ <MacOTPField.Input />
158
+ <MacOTPField.Separator>-</MacOTPField.Separator>
159
+ <MacOTPField.Input />
160
+ </MacOTPField.Root>
161
+ <MacSwitch.Root defaultChecked>
162
+ <MacSwitch.Thumb />
163
+ </MacSwitch.Root>
164
+ </GallerySection>
165
+
166
+ <GallerySection title="Pickers">
167
+ <MacSelect.Root items={choices} defaultValue="general">
168
+ <MacSelect.PopUpButtonTrigger>
169
+ <MacSelect.Value />
170
+ </MacSelect.PopUpButtonTrigger>
171
+ <MacSelect.Portal>
172
+ <MacSelect.Positioner>
173
+ <MacSelect.Popup>
174
+ <MacSelect.List>
175
+ {choices.map((choice) => (
176
+ <MacSelect.Item key={choice.value} value={choice.value}>
177
+ <MacSelect.ItemIndicator />
178
+ <MacSelect.ItemText>{choice.label}</MacSelect.ItemText>
179
+ </MacSelect.Item>
180
+ ))}
181
+ </MacSelect.List>
182
+ </MacSelect.Popup>
183
+ </MacSelect.Positioner>
184
+ </MacSelect.Portal>
185
+ </MacSelect.Root>
186
+ <MacSelect.Root items={choices} defaultValue="display">
187
+ <MacSelect.PullDownButtonTrigger>
188
+ <MacSelect.Value />
189
+ </MacSelect.PullDownButtonTrigger>
190
+ </MacSelect.Root>
191
+ <MacCombobox.Root items={choices}>
192
+ <label className="hd-mac-label">Find</label>
193
+ <MacCombobox.InputGroup>
194
+ <MacCombobox.Input placeholder="Search" />
195
+ <MacCombobox.Trigger>⌄</MacCombobox.Trigger>
196
+ </MacCombobox.InputGroup>
197
+ </MacCombobox.Root>
198
+ <MacAutocomplete.Root items={choices}>
199
+ <MacAutocomplete.InputGroup>
200
+ <MacAutocomplete.Input placeholder="Autocomplete" />
201
+ <MacAutocomplete.Clear>×</MacAutocomplete.Clear>
202
+ </MacAutocomplete.InputGroup>
203
+ </MacAutocomplete.Root>
204
+ </GallerySection>
205
+
206
+ <GallerySection title="Navigation">
207
+ <MacTabs.Root defaultValue="general">
208
+ <MacTabs.List>
209
+ <MacTabs.Tab value="general">General</MacTabs.Tab>
210
+ <MacTabs.Tab value="display">Display</MacTabs.Tab>
211
+ </MacTabs.List>
212
+ <MacTabs.Panel value="general">General settings</MacTabs.Panel>
213
+ <MacTabs.Panel value="display">Display settings</MacTabs.Panel>
214
+ </MacTabs.Root>
215
+ <MacAccordion.Root>
216
+ <MacAccordion.Item value="network">
217
+ <MacAccordion.Header>
218
+ <MacAccordion.Trigger>Network</MacAccordion.Trigger>
219
+ </MacAccordion.Header>
220
+ <MacAccordion.Panel>Wi-Fi and connection settings.</MacAccordion.Panel>
221
+ </MacAccordion.Item>
222
+ </MacAccordion.Root>
223
+ <MacCollapsible.Root>
224
+ <MacCollapsible.Trigger>Details</MacCollapsible.Trigger>
225
+ <MacCollapsible.Panel>Additional controls.</MacCollapsible.Panel>
226
+ </MacCollapsible.Root>
227
+ </GallerySection>
228
+
229
+ <GallerySection title="Menus">
230
+ <MacMenu.Root>
231
+ <MacMenu.Trigger>Menu</MacMenu.Trigger>
232
+ <MacMenu.Portal>
233
+ <MacMenu.Positioner>
234
+ <MacMenu.Popup>
235
+ <MacMenu.Item>New Window</MacMenu.Item>
236
+ <MacMenu.CheckboxItem checked>
237
+ <MacMenu.CheckboxItemIndicator />
238
+ Show Toolbar
239
+ </MacMenu.CheckboxItem>
240
+ <MacMenu.Separator />
241
+ <MacMenu.Item>Preferences</MacMenu.Item>
242
+ </MacMenu.Popup>
243
+ </MacMenu.Positioner>
244
+ </MacMenu.Portal>
245
+ </MacMenu.Root>
246
+ <MacContextMenu.Root>
247
+ <MacContextMenu.Trigger className="hd-mac-gallery-context-target">
248
+ Context target
249
+ </MacContextMenu.Trigger>
250
+ <MacContextMenu.Portal>
251
+ <MacContextMenu.Positioner>
252
+ <MacContextMenu.Popup>
253
+ <MacContextMenu.Item>Rename</MacContextMenu.Item>
254
+ <MacContextMenu.Item>Duplicate</MacContextMenu.Item>
255
+ </MacContextMenu.Popup>
256
+ </MacContextMenu.Positioner>
257
+ </MacContextMenu.Portal>
258
+ </MacContextMenu.Root>
259
+ <MacMenubar>File Edit View</MacMenubar>
260
+ </GallerySection>
261
+
262
+ <GallerySection title="Surfaces">
263
+ <MacPopover.Root>
264
+ <MacPopover.Trigger>Popover</MacPopover.Trigger>
265
+ <MacPopover.Portal>
266
+ <MacPopover.Positioner sideOffset={6}>
267
+ <MacPopover.Popup>
268
+ <MacPopover.Title>Inspector</MacPopover.Title>
269
+ <MacPopover.Description>Contextual controls.</MacPopover.Description>
270
+ </MacPopover.Popup>
271
+ </MacPopover.Positioner>
272
+ </MacPopover.Portal>
273
+ </MacPopover.Root>
274
+ <MacTooltip.Root>
275
+ <MacTooltip.Trigger>Tooltip</MacTooltip.Trigger>
276
+ <MacTooltip.Portal>
277
+ <MacTooltip.Positioner sideOffset={5}>
278
+ <MacTooltip.Popup>Helpful detail</MacTooltip.Popup>
279
+ </MacTooltip.Positioner>
280
+ </MacTooltip.Portal>
281
+ </MacTooltip.Root>
282
+ <MacPreviewCard.Root>
283
+ <MacPreviewCard.Trigger className="hd-mac-button">Preview</MacPreviewCard.Trigger>
284
+ <MacPreviewCard.Portal>
285
+ <MacPreviewCard.Positioner sideOffset={6}>
286
+ <MacPreviewCard.Popup>Preview content</MacPreviewCard.Popup>
287
+ </MacPreviewCard.Positioner>
288
+ </MacPreviewCard.Portal>
289
+ </MacPreviewCard.Root>
290
+ </GallerySection>
291
+
292
+ <GallerySection title="Dialogs">
293
+ <MacDialog.Root>
294
+ <MacDialog.Trigger>Dialog</MacDialog.Trigger>
295
+ <MacDialog.Portal>
296
+ <MacDialog.Backdrop />
297
+ <MacDialog.Popup>
298
+ <MacDialog.Title>Window Sheet</MacDialog.Title>
299
+ <MacDialog.Description>Dialog content styled as a macOS sheet.</MacDialog.Description>
300
+ <MacDialog.Close>Close</MacDialog.Close>
301
+ </MacDialog.Popup>
302
+ </MacDialog.Portal>
303
+ </MacDialog.Root>
304
+ <MacDialog.Root>
305
+ <MacDialog.Trigger>Sheet</MacDialog.Trigger>
306
+ <MacDialog.Portal>
307
+ <MacDialog.Backdrop />
308
+ <MacDialog.SheetPopup>
309
+ <MacDialog.Title>Save Changes?</MacDialog.Title>
310
+ <MacDialog.Description>Sheets stay attached to the active window.</MacDialog.Description>
311
+ <MacDialog.Close>Done</MacDialog.Close>
312
+ </MacDialog.SheetPopup>
313
+ </MacDialog.Portal>
314
+ </MacDialog.Root>
315
+ <MacAlertDialog.Root>
316
+ <MacAlertDialog.Trigger>Alert</MacAlertDialog.Trigger>
317
+ <MacAlertDialog.Portal>
318
+ <MacAlertDialog.Backdrop />
319
+ <MacAlertDialog.Popup>
320
+ <MacAlertDialog.Title>Delete Item?</MacAlertDialog.Title>
321
+ <MacAlertDialog.Description>This cannot be undone.</MacAlertDialog.Description>
322
+ <MacAlertDialog.Close>Cancel</MacAlertDialog.Close>
323
+ </MacAlertDialog.Popup>
324
+ </MacAlertDialog.Portal>
325
+ </MacAlertDialog.Root>
326
+ <MacDrawer.Root>
327
+ <MacDrawer.Trigger>Drawer</MacDrawer.Trigger>
328
+ <MacDrawer.Portal>
329
+ <MacDrawer.Backdrop />
330
+ <MacDrawer.Viewport>
331
+ <MacDrawer.Popup>
332
+ <MacDrawer.Title>Drawer</MacDrawer.Title>
333
+ <MacDrawer.Content>Additional controls.</MacDrawer.Content>
334
+ </MacDrawer.Popup>
335
+ </MacDrawer.Viewport>
336
+ </MacDrawer.Portal>
337
+ </MacDrawer.Root>
338
+ <MacDrawer.Root>
339
+ <MacDrawer.Trigger>Sidebar</MacDrawer.Trigger>
340
+ <MacDrawer.Portal>
341
+ <MacDrawer.Backdrop />
342
+ <MacDrawer.Viewport>
343
+ <MacDrawer.SidebarPopup>
344
+ <MacDrawer.Title>Sidebar</MacDrawer.Title>
345
+ <MacDrawer.Content>Window-adjacent navigation.</MacDrawer.Content>
346
+ </MacDrawer.SidebarPopup>
347
+ </MacDrawer.Viewport>
348
+ </MacDrawer.Portal>
349
+ </MacDrawer.Root>
350
+ </GallerySection>
351
+
352
+ <GallerySection title="States">
353
+ <MacButton disabled>Disabled</MacButton>
354
+ <MacPrimaryButton disabled>Disabled Primary</MacPrimaryButton>
355
+ <MacInput disabled placeholder="Disabled text field" />
356
+ <label className="hd-mac-gallery-inline-choice">
357
+ <MacCheckbox.Root indeterminate>
358
+ <MacCheckbox.Indicator />
359
+ </MacCheckbox.Root>
360
+ Mixed
361
+ </label>
362
+ <MacSwitch.Root>
363
+ <MacSwitch.Thumb />
364
+ </MacSwitch.Root>
365
+ </GallerySection>
366
+
367
+ <GallerySection title="Feedback">
368
+ <MacProgress.Root value={62}>
369
+ <MacProgress.Label>Progress</MacProgress.Label>
370
+ <MacProgress.Track>
371
+ <MacProgress.Indicator />
372
+ </MacProgress.Track>
373
+ <MacProgress.Value />
374
+ </MacProgress.Root>
375
+ <MacMeter.Root value={72}>
376
+ <MacMeter.Label>Storage</MacMeter.Label>
377
+ <MacMeter.Track>
378
+ <MacMeter.Indicator />
379
+ </MacMeter.Track>
380
+ <MacMeter.Value />
381
+ </MacMeter.Root>
382
+ <MacSlider.Root defaultValue={50}>
383
+ <MacSlider.Control>
384
+ <MacSlider.Track>
385
+ <MacSlider.Indicator />
386
+ </MacSlider.Track>
387
+ <MacSlider.Thumb />
388
+ </MacSlider.Control>
389
+ </MacSlider.Root>
390
+ </GallerySection>
391
+
392
+ <GallerySection title="Utility">
393
+ <MacAvatar.Root>
394
+ <MacAvatar.Fallback>HD</MacAvatar.Fallback>
395
+ </MacAvatar.Root>
396
+ <MacNavigationMenu.Root>
397
+ <MacNavigationMenu.List>
398
+ <MacNavigationMenu.Item>
399
+ <MacNavigationMenu.Trigger>Library</MacNavigationMenu.Trigger>
400
+ </MacNavigationMenu.Item>
401
+ </MacNavigationMenu.List>
402
+ </MacNavigationMenu.Root>
403
+ <MacScrollArea.Root className="hd-mac-gallery-scroll">
404
+ <MacScrollArea.Viewport>
405
+ <MacScrollArea.Content>Scrollable macOS content area.</MacScrollArea.Content>
406
+ </MacScrollArea.Viewport>
407
+ <MacScrollArea.Scrollbar>
408
+ <MacScrollArea.Thumb />
409
+ </MacScrollArea.Scrollbar>
410
+ <MacScrollArea.Corner />
411
+ </MacScrollArea.Root>
412
+ <MacToolbar.Root>
413
+ <MacToolbar.Button>New</MacToolbar.Button>
414
+ <MacToolbarToggle value="snap">Snap</MacToolbarToggle>
415
+ <MacToolbar.Separator />
416
+ <MacToolbar.IconButton aria-label="Add">+</MacToolbar.IconButton>
417
+ <MacToolbar.Input placeholder="Filter" />
418
+ </MacToolbar.Root>
419
+ <MacSeparator />
420
+ <MacToast.Provider>
421
+ <MacToast.Viewport />
422
+ </MacToast.Provider>
423
+ </GallerySection>
424
+ </div>
425
+ </MacDirectionProvider>
426
+ </MacCSPProvider>
427
+ );
428
+ }
@@ -1,9 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { FILL, Segment, SegmentedControl } from "baseui/segmented-control";
3
- import {
4
- macosSegmentedControlOverrides,
5
- macosSegmentOverrides,
6
- } from "../theme/macosTheme";
2
+ import { MacSegmentedToggleGroup, MacToggle } from "./MacBaseUI";
7
3
 
8
4
  export type MacSegmentedControlOption<T extends string> = {
9
5
  value: T;
@@ -27,28 +23,29 @@ export function MacSegmentedControl<T extends string>({
27
23
  fullWidth,
28
24
  }: MacSegmentedControlProps<T>) {
29
25
  return (
30
- <SegmentedControl
31
- activeKey={value}
26
+ <MacSegmentedToggleGroup
27
+ aria-disabled={disabled || undefined}
28
+ className={fullWidth ? "hd-mac-segmented-control-full-width" : undefined}
29
+ value={[value]}
32
30
  disabled={disabled}
33
- fill={FILL.fixed}
34
- onChange={({ activeKey }) => {
35
- const nextOption = options.find((option) => option.value === activeKey);
31
+ onValueChange={(nextValue) => {
32
+ const nextOption = options.find((option) => option.value === nextValue[0]);
36
33
  if (!nextOption) {
37
34
  return;
38
35
  }
39
36
  onChange(nextOption.value);
40
37
  }}
41
- overrides={macosSegmentedControlOverrides}
42
- width={fullWidth ? "100%" : undefined}
43
38
  >
44
39
  {options.map((option) => (
45
- <Segment
40
+ <MacToggle
46
41
  key={option.value}
47
- label={option.label}
42
+ value={option.value}
43
+ aria-label={typeof option.label === "string" ? option.label : undefined}
48
44
  disabled={option.disabled}
49
- overrides={macosSegmentOverrides}
50
- />
45
+ >
46
+ {option.label}
47
+ </MacToggle>
51
48
  ))}
52
- </SegmentedControl>
49
+ </MacSegmentedToggleGroup>
53
50
  );
54
51
  }
@@ -1,52 +1,12 @@
1
- import { ReactNode } from "react";
2
- import { Block } from "baseui/block";
3
- import { useStyletron } from "baseui";
4
-
5
1
  type StatusMessageProps = {
6
2
  intent: "error" | "success" | "info";
7
3
  message: string;
8
4
  };
9
5
 
10
6
  export function StatusMessage({ intent, message }: StatusMessageProps) {
11
- const [, theme] = useStyletron();
12
- const isDark = (theme.name ?? "").toLowerCase().includes("dark");
13
-
14
- const palette =
15
- intent === "error"
16
- ? {
17
- background: isDark ? "rgba(255, 84, 89, 0.16)" : "rgba(255, 84, 89, 0.12)",
18
- border: isDark ? "rgba(255, 84, 89, 0.45)" : "rgba(255, 84, 89, 0.35)",
19
- text: isDark ? "#ff9ea2" : "#8f1c1f",
20
- }
21
- : intent === "success"
22
- ? {
23
- background: isDark ? "rgba(52, 199, 89, 0.16)" : "rgba(52, 199, 89, 0.12)",
24
- border: isDark ? "rgba(52, 199, 89, 0.45)" : "rgba(52, 199, 89, 0.3)",
25
- text: isDark ? "#8ff0ad" : "#0f6b2b",
26
- }
27
- : {
28
- background: isDark ? "rgba(10, 132, 255, 0.16)" : "rgba(10, 132, 255, 0.08)",
29
- border: isDark ? "rgba(10, 132, 255, 0.45)" : "rgba(10, 132, 255, 0.25)",
30
- text: isDark ? "#9fcbff" : "#0b4e98",
31
- };
32
-
33
7
  return (
34
- <Block
35
- marginTop="scale400"
36
- paddingTop="scale300"
37
- paddingRight="scale400"
38
- paddingBottom="scale300"
39
- paddingLeft="scale400"
40
- $style={{
41
- backgroundColor: palette.background,
42
- border: `1px solid ${palette.border}`,
43
- borderRadius: "10px",
44
- color: palette.text,
45
- fontSize: "13px",
46
- lineHeight: "1.35",
47
- }}
48
- >
8
+ <div className="hd-mac-status-message" data-intent={intent}>
49
9
  {message}
50
- </Block>
10
+ </div>
51
11
  );
52
12
  }
@@ -1,13 +1,10 @@
1
1
  import { useEffect, useState } from "react";
2
2
  import { invoke } from "@tauri-apps/api/core";
3
- import { Button, KIND, SIZE } from "baseui/button";
4
- import { StatefulTooltip } from "baseui/tooltip";
5
- import { Block } from "baseui/block";
3
+ import { MacButton, MacTooltip } from "./MacBaseUI";
6
4
 
7
5
  const SYMBOL_SCALE_MULTIPLIER = 2.5;
8
6
  const SYMBOL_MIN_POINT_SIZE = 10;
9
7
  const SYMBOL_MAX_POINT_SIZE = 160;
10
- const DEFAULT_SYMBOL_POINT_SIZE = 18;
11
8
 
12
9
  const systemSymbolIconCache = new Map<string, string | null>();
13
10
 
@@ -82,35 +79,30 @@ export function SymbolIconButton({
82
79
  const glyphPx = `${iconSizePx}px`;
83
80
 
84
81
  return (
85
- <StatefulTooltip content={label}>
86
- <Button
87
- aria-label={label}
88
- title={label}
89
- kind={KIND.tertiary}
90
- size={SIZE.compact}
91
- isLoading={isLoading}
92
- disabled={disabled}
93
- onClick={onClick}
94
- overrides={{
95
- BaseButton: {
96
- style: {
82
+ <MacTooltip.Root>
83
+ <MacTooltip.Trigger
84
+ render={
85
+ <MacButton
86
+ aria-label={label}
87
+ title={label}
88
+ disabled={disabled || isLoading}
89
+ onClick={onClick}
90
+ className="hd-mac-symbol-icon-button"
91
+ data-loading={isLoading || undefined}
92
+ style={{
97
93
  width: ICON_BUTTON_SIZE,
98
94
  minWidth: ICON_BUTTON_SIZE,
99
95
  height: ICON_BUTTON_SIZE,
100
96
  minHeight: ICON_BUTTON_SIZE,
101
97
  borderRadius: ICON_BUTTON_RADIUS,
102
- paddingTop: 0,
103
- paddingRight: 0,
104
- paddingBottom: 0,
105
- paddingLeft: 0,
106
- },
107
- },
108
- }}
98
+ padding: 0,
99
+ }}
100
+ />
101
+ }
109
102
  >
110
- <Block
111
- as="span"
103
+ <span
112
104
  aria-hidden
113
- $style={{
105
+ style={{
114
106
  display: "block",
115
107
  width: glyphPx,
116
108
  height: glyphPx,
@@ -131,8 +123,13 @@ export function SymbolIconButton({
131
123
  }}
132
124
  >
133
125
  {symbolDataUrl ? null : fallback}
134
- </Block>
135
- </Button>
136
- </StatefulTooltip>
126
+ </span>
127
+ </MacTooltip.Trigger>
128
+ <MacTooltip.Portal>
129
+ <MacTooltip.Positioner sideOffset={5}>
130
+ <MacTooltip.Popup>{label}</MacTooltip.Popup>
131
+ </MacTooltip.Positioner>
132
+ </MacTooltip.Portal>
133
+ </MacTooltip.Root>
137
134
  );
138
135
  }
@@ -1,14 +1,12 @@
1
- import { Block } from "baseui/block";
2
-
3
1
  type ViewDragRegionProps = {
4
2
  height?: string;
5
3
  };
6
4
 
7
5
  export function ViewDragRegion({ height = "32px" }: ViewDragRegionProps) {
8
6
  return (
9
- <Block
7
+ <div
10
8
  data-tauri-drag-region
11
- $style={{
9
+ style={{
12
10
  height,
13
11
  minHeight: height,
14
12
  flexShrink: 0,
@@ -1,3 +1,5 @@
1
+ export * from "./MacBaseUI";
2
+ export { MacBaseUIGallery } from "./MacBaseUIGallery";
1
3
  export { MacSegmentedControl, type MacSegmentedControlOption } from "./MacSegmentedControl";
2
4
  export { StatusMessage } from "./StatusMessage";
3
5
  export { SymbolIconButton } from "./SymbolIconButton";
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from "./components/MacBaseUI";
2
+ export { MacBaseUIGallery } from "./components/MacBaseUIGallery";
1
3
  export { AppWindowShell } from "./components/AppWindowShell";
2
4
  export { MacSegmentedControl, type MacSegmentedControlOption } from "./components/MacSegmentedControl";
3
5
  export { SymbolIconButton } from "./components/SymbolIconButton";