@blotch/dolan 22.2.3 → 22.2.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.
- package/dist/commands/add.js +9 -1
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/add.test.js +38 -3
- package/dist/commands/add.test.js.map +1 -1
- package/dist/commands/doctor.js +258 -21
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +425 -11
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.js +38 -18
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.test.js +105 -2
- package/dist/commands/init.test.js.map +1 -1
- package/dist/commands/theme.js +1 -1
- package/dist/commands/theme.js.map +1 -1
- package/dist/commands/update.d.ts +7 -0
- package/dist/commands/update.js +194 -50
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/update.test.js +570 -3
- package/dist/commands/update.test.js.map +1 -1
- package/dist/lockfile.d.ts +17 -0
- package/dist/lockfile.js +56 -1
- package/dist/lockfile.js.map +1 -1
- package/dist/lockfile.test.d.ts +1 -0
- package/dist/lockfile.test.js +65 -0
- package/dist/lockfile.test.js.map +1 -0
- package/dist/registry.d.ts +6 -0
- package/dist/registry.js +119 -11
- package/dist/registry.js.map +1 -1
- package/dist/registry.test.js +61 -6
- package/dist/registry.test.js.map +1 -1
- package/dist/test-utils.d.ts +27 -0
- package/dist/test-utils.js +45 -1
- package/dist/test-utils.js.map +1 -1
- package/dist/testing/fire-lynx-event.d.ts +14 -0
- package/dist/testing/fire-lynx-event.js +19 -0
- package/dist/testing/fire-lynx-event.js.map +1 -0
- package/dist/testing/fire-lynx-event.test.d.ts +1 -0
- package/dist/testing/fire-lynx-event.test.js +44 -0
- package/dist/testing/fire-lynx-event.test.js.map +1 -0
- package/dist/testing/lynx-main-thread.d.ts +22 -0
- package/dist/testing/lynx-main-thread.js +11 -0
- package/dist/testing/lynx-main-thread.js.map +1 -0
- package/dist/testing/lynx-main-thread.test.d.ts +1 -0
- package/dist/testing/lynx-main-thread.test.js +24 -0
- package/dist/testing/lynx-main-thread.test.js.map +1 -0
- package/dist/testing/set-input-signal.d.ts +5 -4
- package/dist/testing/set-input-signal.js +5 -4
- package/dist/testing/set-input-signal.js.map +1 -1
- package/dist/ui/boolean-inputs.test.ts +76 -0
- package/dist/ui/components/accordion/accordion.test.ts +158 -144
- package/dist/ui/components/accordion/accordion.ts +19 -14
- package/dist/ui/components/action-sheet/action-sheet.test.ts +637 -183
- package/dist/ui/components/action-sheet/action-sheet.ts +339 -55
- package/dist/ui/components/action-sheet/index.ts +1 -0
- package/dist/ui/components/alert/alert.test.ts +67 -19
- package/dist/ui/components/alert/alert.ts +14 -16
- package/dist/ui/components/alert-dialog/alert-dialog.test.ts +740 -129
- package/dist/ui/components/alert-dialog/alert-dialog.ts +672 -58
- package/dist/ui/components/alert-dialog/index.ts +5 -0
- package/dist/ui/components/area-chart/area-chart.test.ts +81 -1
- package/dist/ui/components/area-chart/area-chart.ts +3 -2
- package/dist/ui/components/avatar/avatar.test.ts +89 -45
- package/dist/ui/components/badge/badge.test.ts +57 -23
- package/dist/ui/components/badge/badge.ts +14 -15
- package/dist/ui/components/bar-chart/bar-chart.test.ts +82 -1
- package/dist/ui/components/bottom-sheet/bottom-sheet.test.ts +1314 -273
- package/dist/ui/components/bottom-sheet/bottom-sheet.ts +1046 -119
- package/dist/ui/components/bottom-sheet/index.ts +7 -1
- package/dist/ui/components/button/button.test.ts +646 -2
- package/dist/ui/components/button/button.ts +443 -64
- package/dist/ui/components/button/index.ts +2 -0
- package/dist/ui/components/button-group/button-group.test.ts +528 -2
- package/dist/ui/components/button-group/button-group.ts +428 -70
- package/dist/ui/components/button-group/index.ts +3 -0
- package/dist/ui/components/candlestick-chart/candlestick-chart.test.ts +82 -1
- package/dist/ui/components/card/card.test.ts +97 -61
- package/dist/ui/components/card/card.ts +2 -1
- package/dist/ui/components/chart/chart-presets.test.ts +197 -1
- package/dist/ui/components/chart/chart-presets.ts +14 -7
- package/dist/ui/components/chart/chart-theme.ts +12 -0
- package/dist/ui/components/chart/chart.test.ts +1031 -0
- package/dist/ui/components/chart/chart.ts +66 -46
- package/dist/ui/components/checkbox/checkbox.test.ts +124 -42
- package/dist/ui/components/checkbox/checkbox.ts +25 -24
- package/dist/ui/components/collapsible/collapsible.test.ts +158 -81
- package/dist/ui/components/collapsible/collapsible.ts +21 -15
- package/dist/ui/components/context-menu/context-menu.test.ts +224 -0
- package/dist/ui/components/context-menu/context-menu.ts +110 -0
- package/dist/ui/components/context-menu/index.ts +1 -0
- package/dist/ui/components/dialog/dialog.test.ts +210 -152
- package/dist/ui/components/dialog/dialog.ts +35 -29
- package/dist/ui/components/dock/dock-scroll.test.ts +130 -0
- package/dist/ui/components/dock/dock-scroll.ts +142 -0
- package/dist/ui/components/dock/dock-search.test.ts +594 -0
- package/dist/ui/components/dock/dock.test.ts +752 -0
- package/dist/ui/components/dock/dock.ts +1438 -0
- package/dist/ui/components/dock/index.ts +2 -0
- package/dist/ui/components/dynamic-color/dynamic-color.test.ts +144 -0
- package/dist/ui/components/dynamic-color/dynamic-color.ts +146 -0
- package/dist/ui/components/dynamic-color/index.ts +5 -0
- package/dist/ui/components/empty-state/empty-state.test.ts +28 -39
- package/dist/ui/components/glass/concentric-radius.test.ts +13 -0
- package/dist/ui/components/glass/concentric-radius.ts +17 -0
- package/dist/ui/components/glass/glass-design.test.ts +78 -0
- package/dist/ui/components/glass/glass-design.ts +119 -0
- package/dist/ui/components/glass/glass.test.ts +376 -0
- package/dist/ui/components/glass/glass.ts +430 -0
- package/dist/ui/components/glass/index.ts +19 -0
- package/dist/ui/components/icon/icon-theme.test.ts +64 -0
- package/dist/ui/components/icon/icon-theme.ts +70 -16
- package/dist/ui/components/icon/icon.test.ts +52 -41
- package/dist/ui/components/input/input.test.ts +178 -101
- package/dist/ui/components/input/input.ts +17 -13
- package/dist/ui/components/label/label.test.ts +11 -24
- package/dist/ui/components/label/label.ts +8 -2
- package/dist/ui/components/line-chart/line-chart.test.ts +76 -1
- package/dist/ui/components/line-chart/line-chart.ts +3 -2
- package/dist/ui/components/list/list.test.ts +80 -49
- package/dist/ui/components/list/list.ts +5 -4
- package/dist/ui/components/menu/index.ts +25 -0
- package/dist/ui/components/menu/menu-placement.test.ts +153 -0
- package/dist/ui/components/menu/menu-placement.ts +159 -0
- package/dist/ui/components/menu/menu-popup.test.ts +636 -0
- package/dist/ui/components/menu/menu-popup.ts +565 -0
- package/dist/ui/components/menu/menu.test.ts +523 -0
- package/dist/ui/components/menu/menu.ts +455 -0
- package/dist/ui/components/nav-drawer/nav-drawer.test.ts +425 -260
- package/dist/ui/components/nav-drawer/nav-drawer.ts +75 -58
- package/dist/ui/components/navigation-bar/index.ts +1 -0
- package/dist/ui/components/navigation-bar/navigation-bar.test.ts +425 -0
- package/dist/ui/components/navigation-bar/navigation-bar.ts +411 -0
- package/dist/ui/components/pagination/pagination.test.ts +136 -86
- package/dist/ui/components/popover/index.ts +9 -0
- package/dist/ui/components/popover/popover-panel.test.ts +735 -0
- package/dist/ui/components/popover/popover-panel.ts +603 -0
- package/dist/ui/components/popover/popover.test.ts +286 -0
- package/dist/ui/components/popover/popover.ts +207 -0
- package/dist/ui/components/progress/progress.test.ts +102 -46
- package/dist/ui/components/progress/progress.ts +54 -55
- package/dist/ui/components/radio-group/radio-group.test.ts +128 -83
- package/dist/ui/components/radio-group/radio-group.ts +26 -25
- package/dist/ui/components/scatter-chart/scatter-chart.test.ts +74 -1
- package/dist/ui/components/scroll-area/scroll-area.test.ts +72 -36
- package/dist/ui/components/scroll-area/scroll-area.ts +4 -3
- package/dist/ui/components/search-field/index.ts +15 -0
- package/dist/ui/components/search-field/keyboard.test.ts +147 -0
- package/dist/ui/components/search-field/keyboard.ts +123 -0
- package/dist/ui/components/search-field/search-field.test.ts +549 -0
- package/dist/ui/components/search-field/search-field.ts +628 -0
- package/dist/ui/components/segmented-control/index.ts +8 -0
- package/dist/ui/components/segmented-control/segmented-control.test.ts +861 -0
- package/dist/ui/components/segmented-control/segmented-control.ts +884 -0
- package/dist/ui/components/select/select.test.ts +138 -78
- package/dist/ui/components/select/select.ts +19 -12
- package/dist/ui/components/separator/separator.test.ts +18 -17
- package/dist/ui/components/sheet/sheet.test.ts +151 -11
- package/dist/ui/components/sheet/sheet.ts +68 -5
- package/dist/ui/components/skeleton/skeleton.test.ts +24 -7
- package/dist/ui/components/skeleton/skeleton.ts +10 -16
- package/dist/ui/components/slider/index.ts +1 -0
- package/dist/ui/components/slider/slider.test.ts +695 -0
- package/dist/ui/components/slider/slider.ts +901 -0
- package/dist/ui/components/spinner/spinner.test.ts +64 -46
- package/dist/ui/components/spinner/spinner.ts +16 -19
- package/dist/ui/components/switch/index.ts +1 -1
- package/dist/ui/components/switch/switch.test.ts +534 -48
- package/dist/ui/components/switch/switch.ts +613 -48
- package/dist/ui/components/tab-bar/index.ts +1 -0
- package/dist/ui/components/tab-bar/tab-bar.test.ts +280 -0
- package/dist/ui/components/tab-bar/tab-bar.ts +230 -0
- package/dist/ui/components/tabs/index.ts +7 -1
- package/dist/ui/components/tabs/tabs.test.ts +484 -150
- package/dist/ui/components/tabs/tabs.ts +344 -149
- package/dist/ui/components/textarea/textarea.test.ts +206 -100
- package/dist/ui/components/textarea/textarea.ts +16 -13
- package/dist/ui/components/toast/toast.test.ts +434 -350
- package/dist/ui/components/toast/toast.ts +42 -51
- package/dist/ui/components/toggle/index.ts +1 -0
- package/dist/ui/components/toggle/toggle.test.ts +559 -146
- package/dist/ui/components/toggle/toggle.ts +241 -26
- package/dist/ui/components/toolbar/bar-scroll.test.ts +310 -0
- package/dist/ui/components/toolbar/bar-scroll.ts +372 -0
- package/dist/ui/components/toolbar/index.ts +12 -0
- package/dist/ui/components/toolbar/toolbar.test.ts +438 -0
- package/dist/ui/components/toolbar/toolbar.ts +535 -0
- package/dist/ui/theme/chart-colors.test.ts +8 -3
- package/dist/ui/theme/dark.css +38 -2
- package/dist/ui/theme/default.css +55 -7
- package/dist/ui/theme/icon-colors.test.ts +8 -3
- package/dist/ui/theme/rgb-channels.test.ts +84 -0
- package/dist/ui/theme/tailwind-build.test.ts +114 -0
- package/dist/ui/theme/tailwind-css.test.ts +83 -0
- package/dist/ui/theme/tailwind-plugin.test.ts +42 -2
- package/dist/ui/theme/tailwind-plugin.ts +93 -29
- package/dist/ui/theme/tailwind.css +113 -0
- package/dist/ui/utils/animate.test.ts +13 -1
- package/dist/utils/analyze.d.ts +19 -0
- package/dist/utils/analyze.js +16 -0
- package/dist/utils/analyze.js.map +1 -1
- package/dist/utils/analyze.test.js +14 -1
- package/dist/utils/analyze.test.js.map +1 -1
- package/dist/utils/installed.d.ts +25 -1
- package/dist/utils/installed.js +33 -0
- package/dist/utils/installed.js.map +1 -1
- package/dist/utils/installed.test.js +55 -1
- package/dist/utils/installed.test.js.map +1 -1
- package/dist/utils/resolve-paths.d.ts +4 -4
- package/dist/utils/resolve-paths.js +5 -7
- package/dist/utils/resolve-paths.js.map +1 -1
- package/dist/utils/resolve-paths.test.js +9 -5
- package/dist/utils/resolve-paths.test.js.map +1 -1
- package/dist/utils/tailwind.d.ts +45 -0
- package/dist/utils/tailwind.js +90 -0
- package/dist/utils/tailwind.js.map +1 -0
- package/dist/utils/tailwind.test.d.ts +1 -0
- package/dist/utils/tailwind.test.js +134 -0
- package/dist/utils/tailwind.test.js.map +1 -0
- package/package.json +9 -1
- package/dist/ui/components/area-chart/area-chart-render.test.ts +0 -63
- package/dist/ui/components/bar-chart/bar-chart-render.test.ts +0 -58
- package/dist/ui/components/button/button-render.test.ts +0 -132
- package/dist/ui/components/button-group/button-group-render.test.ts +0 -146
- package/dist/ui/components/candlestick-chart/candlestick-chart-render.test.ts +0 -59
- package/dist/ui/components/chart/chart-render.test.ts +0 -730
- package/dist/ui/components/line-chart/line-chart-render.test.ts +0 -83
- package/dist/ui/components/scatter-chart/scatter-chart-render.test.ts +0 -64
|
@@ -1,66 +1,84 @@
|
|
|
1
|
+
import { Component, signal } from '@angular/core';
|
|
1
2
|
import { render, waitForUpdate } from '@blotch/angular-lynx-testing-library';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import {
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { lynxMainThread } from '../../../test-utils/lynx-main-thread';
|
|
4
5
|
import { ICON_LIGHT_COLORS } from '../icon/icon-theme';
|
|
5
6
|
import { UiSpinner } from './spinner';
|
|
6
7
|
|
|
8
|
+
@Component({
|
|
9
|
+
imports: [UiSpinner],
|
|
10
|
+
template: `
|
|
11
|
+
<ui-spinner [size]="size()" [color]="color()" [class]="className()" />
|
|
12
|
+
`,
|
|
13
|
+
})
|
|
14
|
+
class SpinnerHost {
|
|
15
|
+
readonly size = signal<'xs' | 'sm' | 'md' | 'lg'>('md');
|
|
16
|
+
readonly color = signal<string | undefined>(undefined);
|
|
17
|
+
readonly className = signal('');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const renderSpinner = async () => {
|
|
21
|
+
const result = await render(SpinnerHost);
|
|
22
|
+
return {
|
|
23
|
+
...result,
|
|
24
|
+
host: result.componentRef.instance as SpinnerHost,
|
|
25
|
+
// The spinner's own view: the one that holds the svg.
|
|
26
|
+
spinner: () => result.container.querySelector('svg')!.parentElement!,
|
|
27
|
+
svgContent: () =>
|
|
28
|
+
result.container.querySelector('svg')!.getAttribute('content'),
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
7
32
|
describe('UiSpinner', () => {
|
|
8
|
-
it('renders the
|
|
9
|
-
const {
|
|
10
|
-
expect(
|
|
11
|
-
|
|
12
|
-
const view = container.querySelector('view');
|
|
13
|
-
expect(view?.getAttribute('style')).toContain('24px');
|
|
33
|
+
it('renders the loader at the default size', async () => {
|
|
34
|
+
const { spinner } = await renderSpinner();
|
|
35
|
+
expect(spinner().getAttribute('style')).toContain('width: 24px');
|
|
36
|
+
expect(spinner().getAttribute('style')).toContain('height: 24px');
|
|
14
37
|
});
|
|
15
38
|
|
|
16
|
-
it('
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
39
|
+
it('resizes for each supported size', async () => {
|
|
40
|
+
const { host, spinner } = await renderSpinner();
|
|
41
|
+
for (const [size, px] of [
|
|
42
|
+
['xs', 16],
|
|
43
|
+
['sm', 20],
|
|
44
|
+
['md', 24],
|
|
45
|
+
['lg', 32],
|
|
46
|
+
] as const) {
|
|
47
|
+
host.size.set(size);
|
|
48
|
+
await waitForUpdate();
|
|
49
|
+
expect(spinner().getAttribute('style')).toContain(`width: ${px}px`);
|
|
50
|
+
}
|
|
24
51
|
});
|
|
25
52
|
|
|
26
53
|
it("draws in the theme's foreground when no color is set", async () => {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
expect(
|
|
30
|
-
expect(
|
|
54
|
+
// Lynx's SVG parser reads neither `currentColor` nor CSS variables.
|
|
55
|
+
const { svgContent } = await renderSpinner();
|
|
56
|
+
expect(svgContent()).toContain(ICON_LIGHT_COLORS['foreground']);
|
|
57
|
+
expect(svgContent()).not.toContain('currentColor');
|
|
31
58
|
});
|
|
32
59
|
|
|
33
|
-
it('
|
|
34
|
-
const {
|
|
35
|
-
|
|
36
|
-
(componentRef.instance as UiSpinner).color,
|
|
37
|
-
'var(--primary-foreground)',
|
|
38
|
-
);
|
|
60
|
+
it('draws in a literal color or a theme token', async () => {
|
|
61
|
+
const { host, svgContent } = await renderSpinner();
|
|
62
|
+
host.color.set('rgb(0, 0, 0)');
|
|
39
63
|
await waitForUpdate();
|
|
40
|
-
expect(
|
|
41
|
-
|
|
42
|
-
);
|
|
64
|
+
expect(svgContent()).toContain('rgb(0, 0, 0)');
|
|
65
|
+
|
|
66
|
+
host.color.set('var(--primary-foreground)');
|
|
67
|
+
await waitForUpdate();
|
|
68
|
+
expect(svgContent()).toContain(ICON_LIGHT_COLORS['primary-foreground']);
|
|
43
69
|
});
|
|
44
70
|
|
|
45
|
-
it('
|
|
46
|
-
const {
|
|
47
|
-
|
|
71
|
+
it('takes the class input', async () => {
|
|
72
|
+
const { host, spinner } = await renderSpinner();
|
|
73
|
+
host.className.set('ml-2');
|
|
48
74
|
await waitForUpdate();
|
|
49
|
-
expect(
|
|
75
|
+
expect(spinner().getAttribute('class')).toBe('ml-2');
|
|
50
76
|
});
|
|
51
77
|
|
|
52
|
-
it('
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
['md', 24],
|
|
58
|
-
['lg', 32],
|
|
59
|
-
] as const) {
|
|
60
|
-
setInputSignal((componentRef.instance as UiSpinner).size, size);
|
|
61
|
-
await waitForUpdate();
|
|
62
|
-
const view = container.querySelector('view');
|
|
63
|
-
expect(view?.getAttribute('style')).toContain(`${px}px`);
|
|
64
|
-
}
|
|
78
|
+
it('turns continuously', async () => {
|
|
79
|
+
const animate = vi.spyOn(lynxMainThread(), '__ElementAnimate');
|
|
80
|
+
const { spinner } = await renderSpinner();
|
|
81
|
+
expect(animate).toHaveBeenCalledWith(spinner(), expect.any(Array));
|
|
82
|
+
animate.mockRestore();
|
|
65
83
|
});
|
|
66
84
|
});
|
|
@@ -43,26 +43,23 @@ export class UiSpinner {
|
|
|
43
43
|
|
|
44
44
|
readonly #resolveColor = injectIconColor();
|
|
45
45
|
|
|
46
|
-
readonly spinnerRef = viewChild<ElementRef>('spinner');
|
|
46
|
+
readonly spinnerRef = viewChild.required<ElementRef>('spinner');
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/* v8 ignore stop */
|
|
64
|
-
});
|
|
65
|
-
}
|
|
48
|
+
/**
|
|
49
|
+
* Turns the spinner for as long as it's shown. A field rather than a
|
|
50
|
+
* constructor: Angular's test build keeps a function for a constructor that
|
|
51
|
+
* nothing calls, which an app's coverage report would show as uncovered.
|
|
52
|
+
*/
|
|
53
|
+
protected readonly rotation = effect(() => {
|
|
54
|
+
this.spinnerRef().nativeElement.animate(
|
|
55
|
+
[{ transform: 'rotate(0deg)' }, { transform: 'rotate(360deg)' }],
|
|
56
|
+
{
|
|
57
|
+
duration: 1600,
|
|
58
|
+
iterations: Infinity,
|
|
59
|
+
easing: 'linear',
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
});
|
|
66
63
|
|
|
67
64
|
// Lynx SVG elements don't inherit the CSS `color` property into their stroke
|
|
68
65
|
// attributes, so we substitute the literal `currentColor` in the SVG string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { UiSwitch } from './switch';
|
|
1
|
+
export { UiSwitch, type SwitchVariant } from './switch';
|