@happyvertical/smrt-ui 0.51.39 → 0.52.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/AGENTS.md +14 -2
- package/README.md +257 -5
- package/dist/actions/__tests__/swipe-dismiss.test.js +69 -0
- package/dist/actions/swipe-dismiss.d.ts +42 -0
- package/dist/actions/swipe-dismiss.d.ts.map +1 -0
- package/dist/actions/swipe-dismiss.js +69 -0
- package/dist/components/calendar/Calendar.svelte +5 -0
- package/dist/components/calendar/Calendar.svelte.d.ts.map +1 -1
- package/dist/components/calendar/CalendarView.svelte +1250 -0
- package/dist/components/calendar/CalendarView.svelte.d.ts +66 -0
- package/dist/components/calendar/CalendarView.svelte.d.ts.map +1 -0
- package/dist/components/calendar/DayView.svelte +5 -0
- package/dist/components/calendar/DayView.svelte.d.ts.map +1 -1
- package/dist/components/calendar/__tests__/CalendarView.test.js +226 -0
- package/dist/components/calendar/__tests__/calendar-model.test.js +138 -0
- package/dist/components/calendar/calendar-model.d.ts +178 -0
- package/dist/components/calendar/calendar-model.d.ts.map +1 -0
- package/dist/components/calendar/calendar-model.js +362 -0
- package/dist/components/calendar/index.d.ts +12 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +11 -1
- package/dist/components/data/CollectionList.svelte +23 -5
- package/dist/components/data/CollectionList.svelte.d.ts +8 -2
- package/dist/components/data/CollectionList.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTable.svelte +118 -40
- package/dist/components/data/DataTable.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTableController.d.ts +4 -0
- package/dist/components/data/DataTableController.d.ts.map +1 -1
- package/dist/components/data/DataTableController.js +11 -4
- package/dist/components/data/ListSortSelect.svelte +121 -0
- package/dist/components/data/ListSortSelect.svelte.d.ts +22 -0
- package/dist/components/data/ListSortSelect.svelte.d.ts.map +1 -0
- package/dist/components/data/SortableHeader.svelte +169 -0
- package/dist/components/data/SortableHeader.svelte.d.ts +30 -0
- package/dist/components/data/SortableHeader.svelte.d.ts.map +1 -0
- package/dist/components/data/__tests__/CollectionList.test.js +37 -0
- package/dist/components/data/__tests__/DataTable.test.js +76 -0
- package/dist/components/data/__tests__/DataTableController.test.js +35 -0
- package/dist/components/data/__tests__/SortableHeader.test.js +101 -0
- package/dist/components/data/__tests__/link-step-surface.test.js +172 -0
- package/dist/components/data/__tests__/list-sort-state.svelte.test.js +71 -0
- package/dist/components/data/__tests__/list-sort.test.js +91 -0
- package/dist/components/data/__tests__/surface-navigation.test.js +121 -0
- package/dist/components/data/data-surface.d.ts +1 -0
- package/dist/components/data/data-surface.d.ts.map +1 -1
- package/dist/components/data/data-surface.js +1 -0
- package/dist/components/data/index.d.ts +6 -0
- package/dist/components/data/index.d.ts.map +1 -1
- package/dist/components/data/index.js +6 -0
- package/dist/components/data/link-surface.d.ts +79 -0
- package/dist/components/data/link-surface.d.ts.map +1 -0
- package/dist/components/data/link-surface.js +155 -0
- package/dist/components/data/list-sort-state.svelte.d.ts +39 -0
- package/dist/components/data/list-sort-state.svelte.d.ts.map +1 -0
- package/dist/components/data/list-sort-state.svelte.js +47 -0
- package/dist/components/data/list-sort.d.ts +94 -0
- package/dist/components/data/list-sort.d.ts.map +1 -0
- package/dist/components/data/list-sort.js +182 -0
- package/dist/components/data/step-surface.d.ts +73 -0
- package/dist/components/data/step-surface.d.ts.map +1 -0
- package/dist/components/data/step-surface.js +177 -0
- package/dist/components/data/surface-navigation.d.ts +49 -0
- package/dist/components/data/surface-navigation.d.ts.map +1 -0
- package/dist/components/data/surface-navigation.js +100 -0
- package/dist/components/data/types.d.ts +19 -0
- package/dist/components/data/types.d.ts.map +1 -1
- package/dist/components/feedback/PhoneSheet.svelte +224 -0
- package/dist/components/feedback/PhoneSheet.svelte.d.ts +35 -0
- package/dist/components/feedback/PhoneSheet.svelte.d.ts.map +1 -0
- package/dist/components/feedback/WorkingStrip.svelte +426 -0
- package/dist/components/feedback/WorkingStrip.svelte.d.ts +37 -0
- package/dist/components/feedback/WorkingStrip.svelte.d.ts.map +1 -0
- package/dist/components/feedback/__tests__/PhoneSheet.test.js +101 -0
- package/dist/components/feedback/__tests__/WorkingStrip.test.js +172 -0
- package/dist/components/feedback/index.d.ts +4 -0
- package/dist/components/feedback/index.d.ts.map +1 -1
- package/dist/components/feedback/index.js +5 -0
- package/dist/components/feedback/working-status.d.ts +34 -0
- package/dist/components/feedback/working-status.d.ts.map +1 -0
- package/dist/components/feedback/working-status.js +5 -0
- package/dist/components/forms/Checkbox.svelte +26 -2
- package/dist/components/forms/Combobox.svelte +68 -12
- package/dist/components/forms/Combobox.svelte.d.ts +6 -0
- package/dist/components/forms/Combobox.svelte.d.ts.map +1 -1
- package/dist/components/forms/DictationButton.svelte +128 -0
- package/dist/components/forms/DictationButton.svelte.d.ts +19 -0
- package/dist/components/forms/DictationButton.svelte.d.ts.map +1 -0
- package/dist/components/forms/DictationStatus.svelte +164 -0
- package/dist/components/forms/DictationStatus.svelte.d.ts +11 -0
- package/dist/components/forms/DictationStatus.svelte.d.ts.map +1 -0
- package/dist/components/forms/Fieldset.svelte +5 -1
- package/dist/components/forms/Fieldset.svelte.d.ts +2 -0
- package/dist/components/forms/Fieldset.svelte.d.ts.map +1 -1
- package/dist/components/forms/FormActionBar.svelte +84 -0
- package/dist/components/forms/FormActionBar.svelte.d.ts +23 -0
- package/dist/components/forms/FormActionBar.svelte.d.ts.map +1 -0
- package/dist/components/forms/Input.svelte +9 -0
- package/dist/components/forms/Radio.svelte +15 -4
- package/dist/components/forms/SearchInput.svelte +207 -0
- package/dist/components/forms/SearchInput.svelte.d.ts +22 -0
- package/dist/components/forms/SearchInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/Select.svelte +9 -0
- package/dist/components/forms/StagedControlReview.svelte +21 -12
- package/dist/components/forms/StagedControlReview.svelte.d.ts.map +1 -1
- package/dist/components/forms/Switch.svelte +11 -5
- package/dist/components/forms/TagsInput.svelte +8 -1
- package/dist/components/forms/Textarea.svelte +8 -0
- package/dist/components/forms/__tests__/Combobox.test.js +87 -0
- package/dist/components/forms/__tests__/ControlHitArea.test.js +73 -0
- package/dist/components/forms/__tests__/DictationButton.test.js +176 -0
- package/dist/components/forms/__tests__/Fieldset.test.js +37 -0
- package/dist/components/forms/__tests__/FormActionBar.test.js +22 -0
- package/dist/components/forms/__tests__/SearchInput.test.js +92 -0
- package/dist/components/forms/__tests__/StagedControlReview.test.js +37 -3
- package/dist/components/forms/__tests__/combobox-labels.fixture.svelte +19 -0
- package/dist/components/forms/__tests__/combobox-labels.fixture.svelte.d.ts +11 -0
- package/dist/components/forms/__tests__/combobox-labels.fixture.svelte.d.ts.map +1 -0
- package/dist/components/forms/__tests__/composite-registration.fixture.svelte +29 -0
- package/dist/components/forms/__tests__/composite-registration.fixture.svelte.d.ts +8 -0
- package/dist/components/forms/__tests__/composite-registration.fixture.svelte.d.ts.map +1 -0
- package/dist/components/forms/__tests__/control-interaction.test.js +19 -1
- package/dist/components/forms/__tests__/control-proposals.test.js +63 -0
- package/dist/components/forms/__tests__/dictation-recording.test.js +582 -0
- package/dist/components/forms/__tests__/dictation.test.js +486 -0
- package/dist/components/forms/__tests__/long-press.test.js +175 -0
- package/dist/components/forms/__tests__/place-picker.fixture.svelte +33 -0
- package/dist/components/forms/__tests__/place-picker.fixture.svelte.d.ts +12 -0
- package/dist/components/forms/__tests__/place-picker.fixture.svelte.d.ts.map +1 -0
- package/dist/components/forms/audio-capture.d.ts +69 -0
- package/dist/components/forms/audio-capture.d.ts.map +1 -0
- package/dist/components/forms/audio-capture.js +193 -0
- package/dist/components/forms/control-interaction.d.ts +6 -0
- package/dist/components/forms/control-interaction.d.ts.map +1 -1
- package/dist/components/forms/control-interaction.js +12 -1
- package/dist/components/forms/control-proposals.d.ts +55 -0
- package/dist/components/forms/control-proposals.d.ts.map +1 -0
- package/dist/components/forms/control-proposals.js +188 -0
- package/dist/components/forms/dictation-transcribe.d.ts +36 -0
- package/dist/components/forms/dictation-transcribe.d.ts.map +1 -0
- package/dist/components/forms/dictation-transcribe.js +65 -0
- package/dist/components/forms/dictation.svelte.d.ts +200 -0
- package/dist/components/forms/dictation.svelte.d.ts.map +1 -0
- package/dist/components/forms/dictation.svelte.js +686 -0
- package/dist/components/forms/index.d.ts +14 -1
- package/dist/components/forms/index.d.ts.map +1 -1
- package/dist/components/forms/index.js +14 -1
- package/dist/components/forms/insert-text.d.ts +12 -0
- package/dist/components/forms/insert-text.d.ts.map +1 -0
- package/dist/components/forms/insert-text.js +38 -0
- package/dist/components/forms/long-press.d.ts +88 -0
- package/dist/components/forms/long-press.d.ts.map +1 -0
- package/dist/components/forms/long-press.js +213 -0
- package/dist/components/forms/ready-beep.d.ts +24 -0
- package/dist/components/forms/ready-beep.d.ts.map +1 -0
- package/dist/components/forms/ready-beep.js +82 -0
- package/dist/components/layout/PageHeader.svelte +151 -17
- package/dist/components/layout/PageHeader.svelte.d.ts +47 -7
- package/dist/components/layout/PageHeader.svelte.d.ts.map +1 -1
- package/dist/components/layout/__tests__/PageHeader.test.js +87 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +1 -0
- package/dist/components/layout/page-header-context.d.ts +25 -0
- package/dist/components/layout/page-header-context.d.ts.map +1 -0
- package/dist/components/layout/page-header-context.js +16 -0
- package/dist/components/nav/Tabs.svelte +241 -0
- package/dist/components/nav/Tabs.svelte.d.ts +15 -0
- package/dist/components/nav/Tabs.svelte.d.ts.map +1 -1
- package/dist/components/nav/__tests__/LinkTabs.test.js +117 -0
- package/dist/components/nav/index.d.ts +1 -0
- package/dist/components/nav/index.d.ts.map +1 -1
- package/dist/components/nav/index.js +1 -0
- package/dist/components/nav/tabs-overflow.d.ts +12 -0
- package/dist/components/nav/tabs-overflow.d.ts.map +1 -0
- package/dist/components/nav/tabs-overflow.js +17 -0
- package/dist/components/nav/types.d.ts +8 -0
- package/dist/components/nav/types.d.ts.map +1 -1
- package/dist/components/ui/Button.svelte +7 -0
- package/dist/components/ui/Card.svelte +14 -5
- package/dist/components/ui/Dropdown.svelte +55 -1
- package/dist/components/ui/Dropdown.svelte.d.ts +8 -0
- package/dist/components/ui/Dropdown.svelte.d.ts.map +1 -1
- package/dist/components/ui/IconToggle.svelte +139 -0
- package/dist/components/ui/IconToggle.svelte.d.ts +32 -0
- package/dist/components/ui/IconToggle.svelte.d.ts.map +1 -0
- package/dist/components/ui/IconToggleGroup.svelte +56 -0
- package/dist/components/ui/IconToggleGroup.svelte.d.ts +21 -0
- package/dist/components/ui/IconToggleGroup.svelte.d.ts.map +1 -0
- package/dist/components/ui/Pagination.svelte +1 -1
- package/dist/components/ui/Popover.svelte +17 -1
- package/dist/components/ui/Popover.svelte.d.ts +8 -0
- package/dist/components/ui/Popover.svelte.d.ts.map +1 -1
- package/dist/components/ui/__tests__/IconToggle.test.js +59 -0
- package/dist/components/ui/__tests__/IconToggleGroup.test.js +30 -0
- package/dist/components/ui/__tests__/Popover.test.js +44 -0
- package/dist/components/ui/__tests__/dropdown-popover-icon.test.js +125 -0
- package/dist/components/ui/__tests__/phone-touch-targets.test.js +39 -0
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +2 -0
- package/dist/i18n/strings.ui.d.ts +41 -0
- package/dist/i18n/strings.ui.d.ts.map +1 -1
- package/dist/i18n/strings.ui.js +46 -0
- package/dist/svelte/__tests__/playground.test.js +1 -0
- package/dist/svelte/playground/CalendarPreview.svelte +140 -0
- package/dist/svelte/playground/CalendarPreview.svelte.d.ts +4 -0
- package/dist/svelte/playground/CalendarPreview.svelte.d.ts.map +1 -0
- package/dist/svelte/playground.d.ts.map +1 -1
- package/dist/svelte/playground.js +10 -0
- package/dist/types-generic.d.ts +2 -0
- package/dist/types-generic.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dropdown menu items take an icon, and Dropdown and Popover each offer an
|
|
3
|
+
* icon-only trigger look (a borderless 44px round button in the surrounding
|
|
4
|
+
* colour), so an app does not restyle `.dropdown__trigger` / `.popover__trigger`.
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync } from 'node:fs';
|
|
7
|
+
import { dirname, resolve } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { render, screen } from '@testing-library/svelte';
|
|
10
|
+
import userEvent from '@testing-library/user-event';
|
|
11
|
+
import { createRawSnippet } from 'svelte';
|
|
12
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
13
|
+
import { expectNoA11yViolations } from '../../../test-support/a11y';
|
|
14
|
+
import Dropdown from '../Dropdown.svelte';
|
|
15
|
+
import Popover from '../Popover.svelte';
|
|
16
|
+
const glyph = createRawSnippet(() => ({
|
|
17
|
+
render: () => '<svg data-testid="glyph" viewBox="0 0 24 24" width="18" height="18"></svg>',
|
|
18
|
+
}));
|
|
19
|
+
const body = createRawSnippet(() => ({ render: () => '<p>Details</p>' }));
|
|
20
|
+
describe('Dropdown icons', () => {
|
|
21
|
+
it('shows an item icon beside the label and hides it from assistive technology', async () => {
|
|
22
|
+
render(Dropdown, {
|
|
23
|
+
props: {
|
|
24
|
+
label: 'Actions',
|
|
25
|
+
items: [
|
|
26
|
+
{ id: 'edit', label: 'Edit', icon: glyph },
|
|
27
|
+
{ id: 'plain', label: 'Plain' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
await userEvent.click(screen.getByRole('button', { name: 'Actions' }));
|
|
32
|
+
const edit = screen.getByRole('menuitem', { name: 'Edit' });
|
|
33
|
+
const icon = edit.querySelector('.dropdown__item-icon');
|
|
34
|
+
expect(icon).not.toBeNull();
|
|
35
|
+
expect(icon).toHaveAttribute('aria-hidden', 'true');
|
|
36
|
+
expect(icon?.querySelector('svg')).not.toBeNull();
|
|
37
|
+
expect(screen
|
|
38
|
+
.getByRole('menuitem', { name: 'Plain' })
|
|
39
|
+
.querySelector('.dropdown__item-icon')).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('is an icon-only 44px trigger named by triggerLabel', async () => {
|
|
42
|
+
const { container } = render(Dropdown, {
|
|
43
|
+
props: {
|
|
44
|
+
variant: 'icon',
|
|
45
|
+
triggerLabel: 'Actions for July 14 Council',
|
|
46
|
+
trigger: glyph,
|
|
47
|
+
items: [{ id: 'edit', label: 'Edit', icon: glyph }],
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const trigger = screen.getByRole('button', {
|
|
51
|
+
name: 'Actions for July 14 Council',
|
|
52
|
+
});
|
|
53
|
+
expect(trigger).toHaveClass('dropdown__trigger--icon');
|
|
54
|
+
expect(trigger).toHaveAttribute('aria-haspopup', 'menu');
|
|
55
|
+
await userEvent.click(trigger);
|
|
56
|
+
await expectNoA11yViolations(container);
|
|
57
|
+
});
|
|
58
|
+
it('an icon trigger falls back to label, and warns when it has no name at all', () => {
|
|
59
|
+
const warn = vi.spyOn(console, 'warn').mockImplementation(() => { });
|
|
60
|
+
render(Dropdown, {
|
|
61
|
+
props: {
|
|
62
|
+
variant: 'icon',
|
|
63
|
+
label: 'Row actions',
|
|
64
|
+
trigger: glyph,
|
|
65
|
+
items: [{ id: 'a', label: 'A' }],
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
expect(screen.getByRole('button', { name: 'Row actions' })).toHaveClass('dropdown__trigger--icon');
|
|
69
|
+
expect(warn).not.toHaveBeenCalled();
|
|
70
|
+
render(Dropdown, {
|
|
71
|
+
props: {
|
|
72
|
+
variant: 'icon',
|
|
73
|
+
trigger: glyph,
|
|
74
|
+
items: [{ id: 'a', label: 'A' }],
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
expect(warn).toHaveBeenCalledWith(expect.stringContaining('triggerLabel'));
|
|
78
|
+
warn.mockRestore();
|
|
79
|
+
});
|
|
80
|
+
it('keeps the bordered button look by default', () => {
|
|
81
|
+
render(Dropdown, {
|
|
82
|
+
props: { label: 'Actions', items: [{ id: 'a', label: 'A' }] },
|
|
83
|
+
});
|
|
84
|
+
expect(screen.getByRole('button', { name: 'Actions' })).not.toHaveClass('dropdown__trigger--icon');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
describe('Popover icon variant', () => {
|
|
88
|
+
it('renders the icon trigger and opens its panel', async () => {
|
|
89
|
+
render(Popover, {
|
|
90
|
+
props: {
|
|
91
|
+
label: 'Issues',
|
|
92
|
+
triggerLabel: '2 issues',
|
|
93
|
+
variant: 'icon',
|
|
94
|
+
trigger: glyph,
|
|
95
|
+
children: body,
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
const trigger = screen.getByRole('button', { name: '2 issues' });
|
|
99
|
+
expect(trigger).toHaveClass('popover__trigger--icon');
|
|
100
|
+
await userEvent.click(trigger);
|
|
101
|
+
expect(screen.getByRole('dialog', { name: 'Issues' })).toHaveTextContent('Details');
|
|
102
|
+
});
|
|
103
|
+
it('an icon trigger without triggerLabel is named by label', () => {
|
|
104
|
+
render(Popover, {
|
|
105
|
+
props: {
|
|
106
|
+
label: 'Issues',
|
|
107
|
+
variant: 'icon',
|
|
108
|
+
trigger: glyph,
|
|
109
|
+
children: body,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
expect(screen.getByRole('button', { name: 'Issues' })).toHaveClass('popover__trigger--icon');
|
|
113
|
+
});
|
|
114
|
+
it('keeps the standard primary focus ring on the icon trigger', () => {
|
|
115
|
+
const source = readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), '..', 'Popover.svelte'), 'utf8');
|
|
116
|
+
const css = source.slice(source.indexOf('<style>'));
|
|
117
|
+
expect(css).toMatch(/\.popover__trigger:focus-visible[^{]*\{ outline: 2px solid var\(--smrt-color-primary\)/);
|
|
118
|
+
// No icon-specific outline override (a currentColor ring under 3:1).
|
|
119
|
+
expect(css).not.toMatch(/\.popover__trigger--icon:focus-visible \{[^}]*outline/);
|
|
120
|
+
});
|
|
121
|
+
it('keeps the bordered button look by default', () => {
|
|
122
|
+
render(Popover, { props: { label: 'Filters', children: body } });
|
|
123
|
+
expect(screen.getByRole('button', { name: 'Filters' })).not.toHaveClass('popover__trigger--icon');
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Touch targets: on phones (48rem and under) Button of every size and the
|
|
3
|
+
* Switch row are at least 44px tall, and TagsInput's remove button is a 44px
|
|
4
|
+
* target on phones and touch screens. The sizing lives in each component's
|
|
5
|
+
* stylesheet, so an app never needs its own `min-height: 44px` override.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { describe, expect, it } from 'vitest';
|
|
10
|
+
const root = process.cwd().endsWith('packages/smrt-ui')
|
|
11
|
+
? process.cwd()
|
|
12
|
+
: join(process.cwd(), 'packages/smrt-ui');
|
|
13
|
+
const read = (path) => readFileSync(join(root, 'src/components', path), 'utf8');
|
|
14
|
+
/** The body of the first `@media (…max-width: 48rem…)` block in `source`. */
|
|
15
|
+
function phoneBlock(source) {
|
|
16
|
+
const start = source.indexOf('@media (max-width: 48rem)');
|
|
17
|
+
expect(start).toBeGreaterThan(-1);
|
|
18
|
+
return source.slice(start, source.indexOf('\n }', start) + 4);
|
|
19
|
+
}
|
|
20
|
+
describe('phone touch targets', () => {
|
|
21
|
+
it('Button is at least 44px tall on phones, in every size', () => {
|
|
22
|
+
const phone = phoneBlock(read('ui/Button.svelte'));
|
|
23
|
+
expect(phone).toMatch(/\.button\s*\{[^}]*min-block-size:\s*2\.75rem/);
|
|
24
|
+
});
|
|
25
|
+
it('Switch is at least 44px tall on phones', () => {
|
|
26
|
+
expect(read('forms/Switch.svelte')).toMatch(/@media \(max-width: 48rem\)\s*\{\s*\.switch\s*\{\s*min-block-size:\s*2\.75rem/);
|
|
27
|
+
});
|
|
28
|
+
it('TagsInput remove buttons are 44px on phones and touch screens', () => {
|
|
29
|
+
const source = read('forms/TagsInput.svelte');
|
|
30
|
+
const start = source.indexOf('@media (max-width: 48rem), (pointer: coarse)');
|
|
31
|
+
expect(start).toBeGreaterThan(-1);
|
|
32
|
+
const block = source.slice(start, source.indexOf('\n }', start));
|
|
33
|
+
expect(block).toMatch(/\.tag button\s*\{[^}]*min-inline-size:\s*2\.75rem/);
|
|
34
|
+
expect(block).toMatch(/\.tag button\s*\{[^}]*min-block-size:\s*2\.75rem/);
|
|
35
|
+
});
|
|
36
|
+
it('Dropdown menu rows are at least 44px tall', () => {
|
|
37
|
+
expect(read('ui/Dropdown.svelte')).toMatch(/\.dropdown__item\s*\{[^}]*min-block-size:\s*2\.75rem/);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -10,6 +10,8 @@ export { default as Card } from './Card.svelte';
|
|
|
10
10
|
export { default as Chip } from './Chip.svelte';
|
|
11
11
|
export { default as Disclosure } from './Disclosure.svelte';
|
|
12
12
|
export { default as Dropdown, default as Menu } from './Dropdown.svelte';
|
|
13
|
+
export { default as IconToggle } from './IconToggle.svelte';
|
|
14
|
+
export { default as IconToggleGroup } from './IconToggleGroup.svelte';
|
|
13
15
|
export { default as Pagination } from './Pagination.svelte';
|
|
14
16
|
export { default as Popover } from './Popover.svelte';
|
|
15
17
|
export { default as Skeleton } from './Skeleton.svelte';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,OAA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EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -11,6 +11,8 @@ export { default as Card } from './Card.svelte';
|
|
|
11
11
|
export { default as Chip } from './Chip.svelte';
|
|
12
12
|
export { default as Disclosure } from './Disclosure.svelte';
|
|
13
13
|
export { default as Dropdown, default as Menu } from './Dropdown.svelte';
|
|
14
|
+
export { default as IconToggle } from './IconToggle.svelte';
|
|
15
|
+
export { default as IconToggleGroup } from './IconToggleGroup.svelte';
|
|
14
16
|
export { default as Pagination } from './Pagination.svelte';
|
|
15
17
|
export { default as Popover } from './Popover.svelte';
|
|
16
18
|
export { default as Skeleton } from './Skeleton.svelte';
|
|
@@ -11,9 +11,50 @@ export declare const M: {
|
|
|
11
11
|
readonly 'ui.calendar.next_month': "ui.calendar.next_month";
|
|
12
12
|
readonly 'ui.calendar.select_month': "ui.calendar.select_month";
|
|
13
13
|
readonly 'ui.calendar.select_year': "ui.calendar.select_year";
|
|
14
|
+
readonly 'ui.calendar.today': "ui.calendar.today";
|
|
15
|
+
readonly 'ui.calendar.more': "ui.calendar.more";
|
|
16
|
+
readonly 'ui.calendar.more_short': "ui.calendar.more_short";
|
|
17
|
+
readonly 'ui.calendar.all_day': "ui.calendar.all_day";
|
|
18
|
+
readonly 'ui.calendar.until': "ui.calendar.until";
|
|
19
|
+
readonly 'ui.calendar.items_one': "ui.calendar.items_one";
|
|
20
|
+
readonly 'ui.calendar.items_other': "ui.calendar.items_other";
|
|
21
|
+
readonly 'ui.calendar.nothing_day': "ui.calendar.nothing_day";
|
|
22
|
+
readonly 'ui.calendar.nothing_month': "ui.calendar.nothing_month";
|
|
23
|
+
readonly 'ui.calendar.days_in': "ui.calendar.days_in";
|
|
24
|
+
readonly 'ui.calendar.close_day': "ui.calendar.close_day";
|
|
14
25
|
readonly 'ui.day_view.back_to_calendar': "ui.day_view.back_to_calendar";
|
|
15
26
|
readonly 'ui.day_view.no_events': "ui.day_view.no_events";
|
|
16
27
|
readonly 'ui.modal.close': "ui.modal.close";
|
|
28
|
+
readonly 'ui.phone_sheet.close': "ui.phone_sheet.close";
|
|
29
|
+
readonly 'ui.working_strip.working': "ui.working_strip.working";
|
|
30
|
+
readonly 'ui.working_strip.done': "ui.working_strip.done";
|
|
31
|
+
readonly 'ui.working_strip.open': "ui.working_strip.open";
|
|
32
|
+
readonly 'ui.working_strip.stop': "ui.working_strip.stop";
|
|
33
|
+
readonly 'ui.working_strip.paused': "ui.working_strip.paused";
|
|
34
|
+
readonly 'ui.working_strip.waiting': "ui.working_strip.waiting";
|
|
35
|
+
readonly 'ui.working_strip.failed': "ui.working_strip.failed";
|
|
36
|
+
readonly 'ui.working_strip.cancelled': "ui.working_strip.cancelled";
|
|
37
|
+
readonly 'ui.working_strip.pause': "ui.working_strip.pause";
|
|
38
|
+
readonly 'ui.working_strip.resume': "ui.working_strip.resume";
|
|
39
|
+
readonly 'ui.working_strip.review': "ui.working_strip.review";
|
|
40
|
+
readonly 'ui.working_strip.dismiss': "ui.working_strip.dismiss";
|
|
41
|
+
readonly 'ui.form_action_bar.label': "ui.form_action_bar.label";
|
|
42
|
+
readonly 'ui.dictation.start': "ui.dictation.start";
|
|
43
|
+
readonly 'ui.dictation.start_hint': "ui.dictation.start_hint";
|
|
44
|
+
readonly 'ui.dictation.stop': "ui.dictation.stop";
|
|
45
|
+
readonly 'ui.dictation.starting': "ui.dictation.starting";
|
|
46
|
+
readonly 'ui.dictation.listening': "ui.dictation.listening";
|
|
47
|
+
readonly 'ui.dictation.unsupported': "ui.dictation.unsupported";
|
|
48
|
+
readonly 'ui.dictation.denied': "ui.dictation.denied";
|
|
49
|
+
readonly 'ui.dictation.no_speech': "ui.dictation.no_speech";
|
|
50
|
+
readonly 'ui.dictation.microphone': "ui.dictation.microphone";
|
|
51
|
+
readonly 'ui.dictation.interrupted': "ui.dictation.interrupted";
|
|
52
|
+
readonly 'ui.dictation.failed': "ui.dictation.failed";
|
|
53
|
+
readonly 'ui.dictation.transcribing': "ui.dictation.transcribing";
|
|
54
|
+
readonly 'ui.dictation.too_long': "ui.dictation.too_long";
|
|
55
|
+
readonly 'ui.dictation.not_transcribed': "ui.dictation.not_transcribed";
|
|
56
|
+
readonly 'ui.dictation.unavailable': "ui.dictation.unavailable";
|
|
57
|
+
readonly 'ui.dictation.forbidden': "ui.dictation.forbidden";
|
|
17
58
|
readonly 'ui.progress_bar.label': "ui.progress_bar.label";
|
|
18
59
|
readonly 'ui.progress_bar.over_by': "ui.progress_bar.over_by";
|
|
19
60
|
readonly 'ui.footer.all_rights_reserved': "ui.footer.all_rights_reserved";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.ui.d.ts","sourceRoot":"","sources":["../../src/i18n/strings.ui.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"strings.ui.d.ts","sourceRoot":"","sources":["../../src/i18n/strings.ui.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkIZ,CAAC"}
|
package/dist/i18n/strings.ui.js
CHANGED
|
@@ -13,11 +13,57 @@ export const M = defineMessages({
|
|
|
13
13
|
'ui.calendar.next_month': 'Next month',
|
|
14
14
|
'ui.calendar.select_month': 'Select month',
|
|
15
15
|
'ui.calendar.select_year': 'Select year',
|
|
16
|
+
// calendar/CalendarView.svelte
|
|
17
|
+
'ui.calendar.today': 'Today',
|
|
18
|
+
'ui.calendar.more': '+{count} more',
|
|
19
|
+
'ui.calendar.more_short': '+{count}',
|
|
20
|
+
'ui.calendar.all_day': 'All day',
|
|
21
|
+
'ui.calendar.until': 'Until {date}',
|
|
22
|
+
'ui.calendar.items_one': '1 item',
|
|
23
|
+
'ui.calendar.items_other': '{count} items',
|
|
24
|
+
'ui.calendar.nothing_day': 'Nothing scheduled',
|
|
25
|
+
'ui.calendar.nothing_month': 'Nothing scheduled this month',
|
|
26
|
+
'ui.calendar.days_in': 'Days in {month}',
|
|
27
|
+
'ui.calendar.close_day': 'Close {date}',
|
|
16
28
|
// calendar/DayView.svelte
|
|
17
29
|
'ui.day_view.back_to_calendar': 'Back to Calendar',
|
|
18
30
|
'ui.day_view.no_events': 'No events scheduled for this day',
|
|
19
31
|
// feedback/Modal.svelte
|
|
20
32
|
'ui.modal.close': 'Close modal',
|
|
33
|
+
// feedback/PhoneSheet.svelte
|
|
34
|
+
'ui.phone_sheet.close': 'Close {title}',
|
|
35
|
+
// feedback/WorkingStrip.svelte
|
|
36
|
+
'ui.working_strip.working': 'Working…',
|
|
37
|
+
'ui.working_strip.done': 'Done',
|
|
38
|
+
'ui.working_strip.open': 'Open',
|
|
39
|
+
'ui.working_strip.stop': 'Stop',
|
|
40
|
+
'ui.working_strip.paused': 'Paused',
|
|
41
|
+
'ui.working_strip.waiting': 'Waiting for you',
|
|
42
|
+
'ui.working_strip.failed': "Couldn't finish",
|
|
43
|
+
'ui.working_strip.cancelled': 'Stopped',
|
|
44
|
+
'ui.working_strip.pause': 'Pause',
|
|
45
|
+
'ui.working_strip.resume': 'Continue',
|
|
46
|
+
'ui.working_strip.review': 'Review',
|
|
47
|
+
'ui.working_strip.dismiss': 'Close',
|
|
48
|
+
// forms/FormActionBar.svelte
|
|
49
|
+
'ui.form_action_bar.label': 'Form actions',
|
|
50
|
+
// forms/DictationButton.svelte, forms/DictationStatus.svelte
|
|
51
|
+
'ui.dictation.start': 'Speak instead of typing',
|
|
52
|
+
'ui.dictation.start_hint': 'Speak instead of typing. You can also press and hold the text box.',
|
|
53
|
+
'ui.dictation.stop': 'Stop listening',
|
|
54
|
+
'ui.dictation.starting': 'Getting the microphone ready…',
|
|
55
|
+
'ui.dictation.listening': 'Listening. Tap the microphone when you are done.',
|
|
56
|
+
'ui.dictation.unsupported': "Speech recognition isn't available in this browser. Brave blocks it; try Chrome, Edge or Safari, or type instead.",
|
|
57
|
+
'ui.dictation.denied': 'The microphone is blocked. Allow it for this site in your browser settings, then try again.',
|
|
58
|
+
'ui.dictation.no_speech': "Didn't hear anything. Tap the mic and try again.",
|
|
59
|
+
'ui.dictation.microphone': "Couldn't use the microphone. Check that one is connected and no other app is using it, then try again.",
|
|
60
|
+
'ui.dictation.interrupted': 'Listening stopped straight away. This browser may not support speaking into text; try Chrome, Edge or Safari, or type instead.',
|
|
61
|
+
'ui.dictation.failed': 'Listening stopped. Tap the microphone to try again.',
|
|
62
|
+
'ui.dictation.transcribing': 'Writing it down…',
|
|
63
|
+
'ui.dictation.too_long': 'That was too long to write down. Try a shorter message, or type instead.',
|
|
64
|
+
'ui.dictation.not_transcribed': "Couldn't write that down. Tap the microphone to try again, or type instead.",
|
|
65
|
+
'ui.dictation.unavailable': "Speaking isn't set up here yet. Please type instead.",
|
|
66
|
+
'ui.dictation.forbidden': "You can't use speaking here. Please type instead.",
|
|
21
67
|
// feedback/ProgressBar.svelte
|
|
22
68
|
'ui.progress_bar.label': 'Progress',
|
|
23
69
|
'ui.progress_bar.over_by': 'Over by {amount}',
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CalendarView from '../../components/calendar/CalendarView.svelte';
|
|
3
|
+
import type {
|
|
4
|
+
CalendarItem,
|
|
5
|
+
CalendarMode,
|
|
6
|
+
} from '../../components/calendar/calendar-model.js';
|
|
7
|
+
import SegmentedControl from '../../components/forms/SegmentedControl.svelte';
|
|
8
|
+
|
|
9
|
+
const zone = 'America/Edmonton';
|
|
10
|
+
const today = new Date();
|
|
11
|
+
const y = today.getUTCFullYear();
|
|
12
|
+
const m = today.getUTCMonth() + 1;
|
|
13
|
+
const pad = (n: number) => String(n).padStart(2, '0');
|
|
14
|
+
const day = (d: number) => `${y}-${pad(m)}-${pad(d)}`;
|
|
15
|
+
const at = (d: number, hour: number) =>
|
|
16
|
+
new Date(`${day(d)}T${pad(hour)}:00:00-06:00`);
|
|
17
|
+
|
|
18
|
+
let mode = $state<CalendarMode>('auto');
|
|
19
|
+
let picked = $state('');
|
|
20
|
+
|
|
21
|
+
const items: CalendarItem[] = [
|
|
22
|
+
{
|
|
23
|
+
id: 'fair',
|
|
24
|
+
title: 'Fall fair',
|
|
25
|
+
start: day(4),
|
|
26
|
+
end: day(7),
|
|
27
|
+
group: 'community',
|
|
28
|
+
label: 'Community',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'council',
|
|
32
|
+
title: 'Council meeting',
|
|
33
|
+
start: at(9, 19),
|
|
34
|
+
end: at(9, 21),
|
|
35
|
+
group: 'council',
|
|
36
|
+
label: 'Council',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'game-1',
|
|
40
|
+
title: 'Hawks vs Owls',
|
|
41
|
+
start: at(12, 13),
|
|
42
|
+
group: 'sports',
|
|
43
|
+
label: 'Sports',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'game-2',
|
|
47
|
+
title: 'Owls vs Crows',
|
|
48
|
+
start: at(12, 15),
|
|
49
|
+
group: 'sports',
|
|
50
|
+
label: 'Sports',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'game-3',
|
|
54
|
+
title: 'Crows vs Hawks',
|
|
55
|
+
start: at(12, 17),
|
|
56
|
+
group: 'sports',
|
|
57
|
+
label: 'Sports',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'game-4',
|
|
61
|
+
title: 'Final',
|
|
62
|
+
start: at(12, 19),
|
|
63
|
+
group: 'sports',
|
|
64
|
+
label: 'Sports',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'deadline',
|
|
68
|
+
title: 'Budget comments close',
|
|
69
|
+
start: day(15),
|
|
70
|
+
tone: 'warning',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'camp',
|
|
74
|
+
title: 'Hockey camp',
|
|
75
|
+
start: at(18, 9),
|
|
76
|
+
end: at(21, 16),
|
|
77
|
+
group: 'sports',
|
|
78
|
+
label: 'Sports',
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<div class="workbench">
|
|
84
|
+
<header>
|
|
85
|
+
<div>
|
|
86
|
+
<p class="eyebrow">Calendar</p>
|
|
87
|
+
<h4>Month grid, all-day bands, and the phone agenda ({zone})</h4>
|
|
88
|
+
</div>
|
|
89
|
+
<SegmentedControl
|
|
90
|
+
label="Mode"
|
|
91
|
+
value={mode}
|
|
92
|
+
interaction={false}
|
|
93
|
+
options={[
|
|
94
|
+
{ value: 'auto', label: 'Auto' },
|
|
95
|
+
{ value: 'month', label: 'Month' },
|
|
96
|
+
{ value: 'agenda', label: 'Agenda' },
|
|
97
|
+
]}
|
|
98
|
+
onvaluechange={(value) => (mode = value as CalendarMode)}
|
|
99
|
+
/>
|
|
100
|
+
</header>
|
|
101
|
+
<CalendarView
|
|
102
|
+
{items}
|
|
103
|
+
{mode}
|
|
104
|
+
timeZone={zone}
|
|
105
|
+
onItemSelect={(item) => (picked = item.title)}
|
|
106
|
+
/>
|
|
107
|
+
<p class="picked" aria-live="polite">{picked ? `Selected: ${picked}` : ''}</p>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<style>
|
|
111
|
+
.workbench {
|
|
112
|
+
display: grid;
|
|
113
|
+
gap: var(--smrt-spacing-4, 1rem);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
header {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
gap: var(--smrt-spacing-3, 0.75rem);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.eyebrow {
|
|
124
|
+
margin: 0;
|
|
125
|
+
color: var(--smrt-color-on-surface-variant, #44474e);
|
|
126
|
+
font-size: var(--smrt-typography-label-medium-size, 0.75rem);
|
|
127
|
+
text-transform: uppercase;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
h4 {
|
|
131
|
+
margin: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
.picked {
|
|
136
|
+
margin: 0;
|
|
137
|
+
min-height: 1.5rem;
|
|
138
|
+
color: var(--smrt-color-on-surface-variant, #44474e);
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarPreview.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/playground/CalendarPreview.svelte.ts"],"names":[],"mappings":"AA6GA,QAAA,MAAM,eAAe,2DAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../src/svelte/playground.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../../src/svelte/playground.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AASA,wBA2EE"}
|
|
@@ -3,6 +3,7 @@ const loadDataTable = () => import('./playground/DataTablePreview.svelte');
|
|
|
3
3
|
const loadInteractiveControls = () => import('./playground/InteractiveControlsPreview.svelte');
|
|
4
4
|
const loadFeedback = () => import('./playground/FeedbackPreview.svelte');
|
|
5
5
|
const loadCollections = () => import('./playground/CollectionsPreview.svelte');
|
|
6
|
+
const loadCalendar = () => import('./playground/CalendarPreview.svelte');
|
|
6
7
|
export default {
|
|
7
8
|
packageName: '@happyvertical/smrt-ui',
|
|
8
9
|
displayName: 'UI Foundation',
|
|
@@ -61,5 +62,14 @@ export default {
|
|
|
61
62
|
},
|
|
62
63
|
},
|
|
63
64
|
},
|
|
65
|
+
{
|
|
66
|
+
id: 'calendar',
|
|
67
|
+
title: 'Calendar',
|
|
68
|
+
description: 'Time-zone-aware month grid with all-day bands and "+N more", and the phone agenda (day strip + day list).',
|
|
69
|
+
loadComponent: loadCalendar,
|
|
70
|
+
order: 6,
|
|
71
|
+
tags: ['calendar', 'events', 'agenda', 'mobile'],
|
|
72
|
+
modes: { mock: { label: 'Interactive' } },
|
|
73
|
+
},
|
|
64
74
|
],
|
|
65
75
|
};
|
package/dist/types-generic.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export interface MenuItem {
|
|
|
48
48
|
label: string;
|
|
49
49
|
/** Disable this item. */
|
|
50
50
|
disabled?: boolean;
|
|
51
|
+
/** Leading icon (any icon set). Decorative: hidden from assistive technology. */
|
|
52
|
+
icon?: Snippet;
|
|
51
53
|
/** Per-item activation handler. */
|
|
52
54
|
onselect?: () => void;
|
|
53
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-generic.d.ts","sourceRoot":"","sources":["../src/types-generic.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAGzB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AAW,GACX,SAAS,CAAC;AAEd,sCAAsC;AACtC,MAAM,WAAW,QAAQ;IACvB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,0BAA0B;AAC1B,MAAM,WAAW,QAAQ;IACvB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAGD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAG1D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Domain-agnostic Svelte 5 UI runtime for SMRT: primitives, i18n client, theme system, and module UI registry",
|
|
6
6
|
"type": "module",
|
|
@@ -129,11 +129,11 @@
|
|
|
129
129
|
"access": "public"
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"@happyvertical/smrt-types": "0.
|
|
132
|
+
"@happyvertical/smrt-types": "0.52.0",
|
|
133
133
|
"esm-env": "^1.2.2"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"svelte": "^5.57.
|
|
136
|
+
"svelte": "^5.57.0"
|
|
137
137
|
},
|
|
138
138
|
"peerDependenciesMeta": {
|
|
139
139
|
"svelte": {
|