srcdev-nuxt-components 9.1.49 → 9.1.50
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/.claude/settings.json +2 -4
- package/.claude/settings.local.json +22 -2
- package/.claude/skills/components/card-core.md +205 -0
- package/.claude/skills/components/display-dialog.md +128 -0
- package/.claude/skills/components/page-hero-highlights.md +1 -1
- package/.claude/skills/components/page-row.md +157 -0
- package/.claude/skills/components/services-card-grid.md +4 -4
- package/.claude/skills/components/services-section-grid.md +4 -4
- package/.claude/skills/components/tab-navigation.md +222 -0
- package/.claude/skills/composable-dialog-controls.md +55 -43
- package/.claude/skills/index.md +5 -2
- package/app/components/01.atoms/card/CONSUMER-STYLING.md +175 -0
- package/app/components/01.atoms/card/CardCore.vue +48 -21
- package/app/components/01.atoms/display-dialog/CONSUMER-STYLING.md +163 -0
- package/app/components/01.atoms/display-dialog/DisplayDialog.vue +277 -0
- package/app/components/01.atoms/display-dialog/stories/DisplayDialog.stories.ts +177 -0
- package/app/components/01.atoms/display-dialog/tests/DisplayDialog.spec.ts +264 -0
- package/app/components/01.atoms/display-dialog/tests/__snapshots__/DisplayDialog.spec.ts.snap +18 -0
- package/app/components/01.atoms/page-row/CONSUMER-STYLING.md +90 -0
- package/app/components/01.atoms/page-row/PageRow.vue +115 -0
- package/app/components/01.atoms/page-row/stories/PageRow.stories.ts +311 -0
- package/app/components/01.atoms/page-row/tests/PageRow.spec.ts +191 -0
- package/app/components/02.molecules/navigation/tab-navigation/CONSUMER-STYLING.md +145 -0
- package/app/components/02.molecules/navigation/tab-navigation/TabNavigation.vue +21 -11
- package/app/components/02.molecules/navigation/tab-navigation/tests/__snapshots__/TabNavigation.spec.ts.snap +12 -6
- package/app/components/{forms/ui → 05.forms/form-field}/FormField.vue +12 -19
- package/app/components/{forms/ui → 05.forms/form-wrapper}/FormWrapper.vue +6 -6
- package/app/components/{forms → 05.forms}/input-button/InputButtonCore.vue +2 -0
- package/app/components/{forms → 05.forms}/input-button/stories/InputButtonCore.stories.ts +1 -1
- package/app/components/{forms → 05.forms}/input-text/InputTextCore.vue +73 -73
- package/app/components/{forms → 05.forms}/input-text/variants/InputTextAsNumberWithLabel.vue +29 -29
- package/app/components/carousels/CarouselBasic.vue +99 -99
- package/app/components/carousels/CarouselInfinite.vue +150 -150
- package/app/components/deep-expanding-menu/DeepExpandingMenu.vue +111 -111
- package/app/components/responsive-header/ResponsiveHeader.vue +250 -282
- package/app/components/test-storybook/TestStorybook.vue +16 -16
- package/app/composables/tests/useDialogControls.spec.ts +34 -64
- package/app/composables/useDialogControls.ts +19 -33
- package/app/composables/useFormControl.ts +0 -2
- package/app/layouts/default.vue +9 -7
- package/app/pages/auto-grid.vue +37 -20
- package/app/pages/banner-video.vue +2 -2
- package/app/pages/forms/examples/buttons/index.vue +189 -215
- package/app/pages/forms/examples/material/text-fields.vue +2 -2
- package/app/pages/grid-stack.vue +10 -10
- package/app/pages/index.vue +20 -20
- package/app/pages/samaritan.vue +4 -4
- package/app/pages/typography/hero-text.vue +6 -6
- package/app/pages/typography/index.vue +4 -4
- package/app/pages/typography/page-body.vue +4 -4
- package/app/pages/typography/page-heading.vue +4 -4
- package/app/pages/typography/page-link.vue +4 -4
- package/app/pages/ui/accordian.vue +4 -4
- package/app/pages/ui/anchor-scroll-tab-navigation.vue +77 -66
- package/app/pages/ui/anchor-scroll.vue +94 -70
- package/app/pages/ui/animated-svg-text.vue +4 -4
- package/app/pages/ui/block-decorators.vue +11 -11
- package/app/pages/ui/card-core.vue +9 -9
- package/app/pages/ui/carousel-basic.vue +4 -4
- package/app/pages/ui/carousel-flip.vue +2 -2
- package/app/pages/ui/carousel-infinite.vue +4 -4
- package/app/pages/ui/clipped-panels.vue +10 -10
- package/app/pages/ui/contact-section.vue +4 -4
- package/app/pages/ui/container-glow.vue +2 -3
- package/app/pages/ui/deep-expanding-menu.vue +138 -0
- package/app/pages/ui/display-avatar.vue +2 -2
- package/app/pages/ui/display-banner.vue +2 -2
- package/app/pages/ui/display-chip.vue +32 -25
- package/app/pages/ui/display-details.vue +6 -10
- package/app/pages/ui/display-dialog.vue +96 -131
- package/app/pages/ui/display-pill.vue +27 -33
- package/app/pages/ui/display-prompt.vue +4 -4
- package/app/pages/ui/display-toast.vue +2 -2
- package/app/pages/ui/expanding-panel.vue +12 -16
- package/app/pages/ui/glowing-border.vue +12 -12
- package/app/pages/ui/layout-grid-a.vue +6 -6
- package/app/pages/ui/layout-grid-b.vue +4 -4
- package/app/pages/ui/magnetic-navigation.vue +6 -6
- package/app/pages/ui/marquee-scroller.vue +2 -2
- package/app/pages/ui/mask-element.vue +2 -2
- package/app/pages/ui/masonry-columns.vue +4 -4
- package/app/pages/ui/masonry-grid-ordered-experiment.vue +4 -4
- package/app/pages/ui/masonry-grid-ordered.vue +4 -4
- package/app/pages/ui/masonry-grid-sorted.vue +4 -4
- package/app/pages/ui/masonry-grid.vue +4 -4
- package/app/pages/ui/navigation/navigation-horizontal.vue +12 -12
- package/app/pages/ui/navigation/tab-navigation.vue +493 -0
- package/app/pages/ui/page-row.vue +127 -0
- package/app/pages/ui/price-list.vue +4 -4
- package/app/pages/ui/profile-section.vue +4 -4
- package/app/pages/ui/qr-code/[componentName].vue +6 -6
- package/app/pages/ui/rotating-carousel.vue +16 -16
- package/app/pages/ui/scroll-reveal-image.vue +20 -20
- package/app/pages/ui/section-parallax.vue +7 -7
- package/app/pages/ui/services/colour-finder.vue +4 -4
- package/app/pages/ui/services/services-cards.vue +4 -4
- package/app/pages/ui/services/services-section/[slug].vue +4 -4
- package/app/pages/ui/services/services-sections-compact.vue +6 -6
- package/app/pages/ui/settings.vue +10 -10
- package/app/pages/ui/simple-grid.vue +2 -2
- package/app/pages/ui/slider-gallery.vue +5 -5
- package/app/pages/ui/tabs-y.vue +2 -3
- package/app/pages/ui/tabs.vue +6 -9
- package/app/pages/ui/tooltips.vue +9 -9
- package/app/pages/ui/wipe-away-vertical.vue +14 -14
- package/package.json +1 -1
- package/.claude/skills/components/layout-row.md +0 -239
- package/app/components/display-dialog/DisplayDialogCore.vue +0 -276
- package/app/components/display-dialog/variants/DisplayDialogConfirm.vue +0 -47
- package/app/components/display-dialog/variants/DisplayDialogScrollableContent.vue +0 -51
- package/app/components/forms/c12/utils.ts +0 -14
- package/app/components/layout-row/LayoutRow.vue +0 -171
- package/app/components/layout-row/stories/LayoutRow.stories.ts +0 -528
- package/app/pages/ui/layout-row.vue +0 -139
- /package/app/components/{forms → 05.forms}/form-errors/InputError.vue +0 -0
- /package/app/components/{forms → 05.forms}/form-errors/tests/InputError.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/form-fieldset/FormFieldset.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-icons-secondary-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-icons-secondary-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-icons-secondary-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-icons-tertiary-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-icons-tertiary-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-icons-tertiary-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-primary-pending-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-primary-pending-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-primary-pending-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-secondary-pill-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-secondary-pill-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-secondary-pill-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-tertiary-readonly-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-tertiary-readonly-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/combo-tertiary-readonly-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-default-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-default-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-default-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-error-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-error-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-error-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-success-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-success-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-success-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-warning-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-warning-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-theme-warning-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-primary-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-primary-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-primary-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-secondary-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-secondary-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-secondary-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-tertiary-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-tertiary-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-variant-tertiary-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/default-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/nuxt-icon-only-component-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/nuxt-icon-only-component-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/nuxt-icon-only-component-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-pending-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-pending-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-pending-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-pill-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-pill-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-pill-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-readonly-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-readonly-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/state-readonly-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/with-both-nuxt-icon-components-chromium-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/with-both-nuxt-icon-components-firefox-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/playwright/input-button-core.playwright.ts-snapshots/with-both-nuxt-icon-components-webkit-darwin.png +0 -0
- /package/app/components/{forms → 05.forms}/input-button/tests/InputButtonCore.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-button/tests/__snapshots__/InputButtonCore.spec.ts.snap +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox/MultipleCheckboxes.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox/SingleCheckbox.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox/tests/MultipleCheckboxes.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox/tests/data/tags.json +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox-radio/InputCheckboxRadioButton.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox-radio/InputCheckboxRadioCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox-radio/InputCheckboxRadioWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-checkbox-radio/tests/InputCheckboxRadioCore.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-copy/InputCopyCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-copy/stories/InputCopyCore.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-copy/tests/InputCopyCore.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-copy/tests/__snapshots__/InputCopyCore.spec.ts.snap +0 -0
- /package/app/components/{forms → 05.forms}/input-description/InputDescription.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-description/tests/InputDescription.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-label/InputLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-label/tests/InputLabel.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-number/InputNumberCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-number/variants/InputNumberDefault.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-radio/MultipleRadiobuttons.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-radio/tests/MultipleRadioButtons.spec.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-radio/tests/data/tags.json +0 -0
- /package/app/components/{forms → 05.forms}/input-range/InputRangeCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-range/variants/InputRangeDefault.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-range-fancy/InputRangeFancyCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-range-fancy/InputRangeFancyWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-select/InputSelectCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-select/variants/InputSelectWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-text/stories/InputPasswordWithLabel.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-text/stories/InputTextAsNumberWithLabel.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-text/stories/InputTextCore.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-text/stories/InputTextWithLabel.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-text/variants/InputPasswordWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-text/variants/InputTextWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-textarea/InputTextareaCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/input-textarea/stories/InputTextareaCore.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-textarea/stories/InputTextareaWithLabel.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/input-textarea/variants/InputTextareaWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/pending-effect/PendingEffect.vue +0 -0
- /package/app/components/{forms → 05.forms}/toggle-switch/ToggleSwitchCore.vue +0 -0
- /package/app/components/{forms → 05.forms}/toggle-switch/stories/ToggleSwitchCore.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/toggle-switch/stories/ToggleSwitchWithLabel.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/toggle-switch/stories/ToggleSwitchWithLabelInline.stories.ts +0 -0
- /package/app/components/{forms → 05.forms}/toggle-switch/variants/ToggleSwitchWithLabel.vue +0 -0
- /package/app/components/{forms → 05.forms}/toggle-switch/variants/ToggleSwitchWithLabelInline.vue +0 -0
- /package/app/components/{forms → 05.forms}/triple-toggle-switch/TripleToggleSwitchCore.vue +0 -0
- /package/app/{components/forms/c12/prop-validators/index.ts → utils/prop-validators.ts} +0 -0
|
@@ -2,107 +2,77 @@ import { describe, it, expect, vi } from "vitest";
|
|
|
2
2
|
import { useDialogControls } from "../useDialogControls";
|
|
3
3
|
|
|
4
4
|
describe("useDialogControls", () => {
|
|
5
|
-
// ───
|
|
5
|
+
// ─── initialisation ───────────────────────────────────────────────────────
|
|
6
6
|
|
|
7
|
-
describe("
|
|
7
|
+
describe("initialisation", () => {
|
|
8
8
|
it("registers each dialog id as false", () => {
|
|
9
|
-
const { dialogsConfig
|
|
10
|
-
initialiseDialogs(["confirm", "delete"]);
|
|
9
|
+
const { dialogsConfig } = useDialogControls({ confirm: {}, delete: {} });
|
|
11
10
|
expect(dialogsConfig.confirm).toBe(false);
|
|
12
11
|
expect(dialogsConfig.delete).toBe(false);
|
|
13
12
|
});
|
|
14
13
|
|
|
15
|
-
it("
|
|
16
|
-
const { dialogsConfig
|
|
17
|
-
|
|
18
|
-
controlDialogs("a", true);
|
|
19
|
-
initialiseDialogs(["b"]);
|
|
20
|
-
expect(dialogsConfig.a).toBe(true); // unchanged
|
|
21
|
-
expect(dialogsConfig.b).toBe(false);
|
|
14
|
+
it("defaults to empty config when called with no arguments", () => {
|
|
15
|
+
const { dialogsConfig } = useDialogControls();
|
|
16
|
+
expect(Object.keys(dialogsConfig)).toHaveLength(0);
|
|
22
17
|
});
|
|
23
18
|
});
|
|
24
19
|
|
|
25
|
-
// ───
|
|
20
|
+
// ─── openDialog ───────────────────────────────────────────────────────────
|
|
26
21
|
|
|
27
|
-
describe("
|
|
28
|
-
it("sets dialog state to true
|
|
29
|
-
const { dialogsConfig,
|
|
30
|
-
|
|
31
|
-
controlDialogs("modal", true);
|
|
22
|
+
describe("openDialog", () => {
|
|
23
|
+
it("sets dialog state to true", () => {
|
|
24
|
+
const { dialogsConfig, openDialog } = useDialogControls({ modal: {} });
|
|
25
|
+
openDialog("modal");
|
|
32
26
|
expect(dialogsConfig.modal).toBe(true);
|
|
33
27
|
});
|
|
34
28
|
|
|
35
|
-
it("sets dialog state to false (close)", () => {
|
|
36
|
-
const { dialogsConfig, initialiseDialogs, controlDialogs } = useDialogControls();
|
|
37
|
-
initialiseDialogs(["modal"]);
|
|
38
|
-
controlDialogs("modal", true);
|
|
39
|
-
controlDialogs("modal", false);
|
|
40
|
-
expect(dialogsConfig.modal).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
29
|
it("multiple dialogs are independent", () => {
|
|
44
|
-
const { dialogsConfig,
|
|
45
|
-
|
|
46
|
-
controlDialogs("a", true);
|
|
30
|
+
const { dialogsConfig, openDialog } = useDialogControls({ a: {}, b: {} });
|
|
31
|
+
openDialog("a");
|
|
47
32
|
expect(dialogsConfig.a).toBe(true);
|
|
48
33
|
expect(dialogsConfig.b).toBe(false);
|
|
49
34
|
});
|
|
50
35
|
});
|
|
51
36
|
|
|
52
|
-
// ───
|
|
37
|
+
// ─── closeDialog ──────────────────────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
describe("closeDialog", () => {
|
|
40
|
+
it("sets dialog state to false", () => {
|
|
41
|
+
const { dialogsConfig, openDialog, closeDialog } = useDialogControls({ modal: {} });
|
|
42
|
+
openDialog("modal");
|
|
43
|
+
closeDialog("modal");
|
|
44
|
+
expect(dialogsConfig.modal).toBe(false);
|
|
45
|
+
});
|
|
53
46
|
|
|
54
|
-
describe("callbacks", () => {
|
|
55
47
|
it("fires onConfirm when closing with action='confirm'", () => {
|
|
56
|
-
const { initialiseDialogs, controlDialogs, registerDialogCallbacks } = useDialogControls();
|
|
57
|
-
initialiseDialogs(["modal"]);
|
|
58
48
|
const onConfirm = vi.fn();
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
const { openDialog, closeDialog } = useDialogControls({ modal: { onConfirm } });
|
|
50
|
+
openDialog("modal");
|
|
51
|
+
closeDialog("modal", "confirm");
|
|
61
52
|
expect(onConfirm).toHaveBeenCalledOnce();
|
|
62
53
|
});
|
|
63
54
|
|
|
64
55
|
it("fires onCancel when closing with action='cancel'", () => {
|
|
65
|
-
const { initialiseDialogs, controlDialogs, registerDialogCallbacks } = useDialogControls();
|
|
66
|
-
initialiseDialogs(["modal"]);
|
|
67
56
|
const onCancel = vi.fn();
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
const { openDialog, closeDialog } = useDialogControls({ modal: { onCancel } });
|
|
58
|
+
openDialog("modal");
|
|
59
|
+
closeDialog("modal", "cancel");
|
|
70
60
|
expect(onCancel).toHaveBeenCalledOnce();
|
|
71
61
|
});
|
|
72
62
|
|
|
73
|
-
it("does not fire onConfirm when opening (state=true)", () => {
|
|
74
|
-
const { initialiseDialogs, controlDialogs, registerDialogCallbacks } = useDialogControls();
|
|
75
|
-
initialiseDialogs(["modal"]);
|
|
76
|
-
const onConfirm = vi.fn();
|
|
77
|
-
registerDialogCallbacks("modal", { onConfirm });
|
|
78
|
-
controlDialogs("modal", true, "confirm");
|
|
79
|
-
expect(onConfirm).not.toHaveBeenCalled();
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it("does not fire onCancel when opening (state=true)", () => {
|
|
83
|
-
const { initialiseDialogs, controlDialogs, registerDialogCallbacks } = useDialogControls();
|
|
84
|
-
initialiseDialogs(["modal"]);
|
|
85
|
-
const onCancel = vi.fn();
|
|
86
|
-
registerDialogCallbacks("modal", { onCancel });
|
|
87
|
-
controlDialogs("modal", true, "cancel");
|
|
88
|
-
expect(onCancel).not.toHaveBeenCalled();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
63
|
it("does not fire onConfirm when closing without an action", () => {
|
|
92
|
-
const { initialiseDialogs, controlDialogs, registerDialogCallbacks } = useDialogControls();
|
|
93
|
-
initialiseDialogs(["modal"]);
|
|
94
64
|
const onConfirm = vi.fn();
|
|
95
|
-
|
|
96
|
-
|
|
65
|
+
const { openDialog, closeDialog } = useDialogControls({ modal: { onConfirm } });
|
|
66
|
+
openDialog("modal");
|
|
67
|
+
closeDialog("modal");
|
|
97
68
|
expect(onConfirm).not.toHaveBeenCalled();
|
|
98
69
|
});
|
|
99
70
|
|
|
100
71
|
it("does not fire confirm callback for a different dialog", () => {
|
|
101
|
-
const { initialiseDialogs, controlDialogs, registerDialogCallbacks } = useDialogControls();
|
|
102
|
-
initialiseDialogs(["a", "b"]);
|
|
103
72
|
const onConfirm = vi.fn();
|
|
104
|
-
|
|
105
|
-
|
|
73
|
+
const { openDialog, closeDialog } = useDialogControls({ a: { onConfirm }, b: {} });
|
|
74
|
+
openDialog("b");
|
|
75
|
+
closeDialog("b", "confirm");
|
|
106
76
|
expect(onConfirm).not.toHaveBeenCalled();
|
|
107
77
|
});
|
|
108
78
|
});
|
|
@@ -1,44 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface DialogCallbacks {
|
|
7
|
-
[key: string]: {
|
|
8
|
-
onConfirm?: () => void;
|
|
9
|
-
onCancel?: () => void;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
1
|
+
type DialogCallbacks = {
|
|
2
|
+
onConfirm?: () => void;
|
|
3
|
+
onCancel?: () => void;
|
|
4
|
+
};
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
const dialogCallbacks = reactive<DialogCallbacks>({});
|
|
6
|
+
type DialogsSetupConfig = Record<string, DialogCallbacks>;
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
8
|
+
export const useDialogControls = (config: DialogsSetupConfig = {}) => {
|
|
9
|
+
const dialogsConfig = reactive<Record<string, boolean>>(
|
|
10
|
+
Object.fromEntries(Object.keys(config).map((id) => [id, false]))
|
|
11
|
+
);
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
13
|
+
const openDialog = (name: string) => {
|
|
14
|
+
dialogsConfig[name] = true;
|
|
15
|
+
};
|
|
25
16
|
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
if (action ===
|
|
30
|
-
dialogCallbacks[name].onConfirm!();
|
|
31
|
-
} else if (action === 'cancel' && dialogCallbacks[name].onCancel) {
|
|
32
|
-
dialogCallbacks[name].onCancel!();
|
|
33
|
-
}
|
|
17
|
+
const closeDialog = (name: string, action?: "confirm" | "cancel") => {
|
|
18
|
+
if (action && config[name]) {
|
|
19
|
+
if (action === "confirm") config[name].onConfirm?.();
|
|
20
|
+
else if (action === "cancel") config[name].onCancel?.();
|
|
34
21
|
}
|
|
35
|
-
dialogsConfig[name] =
|
|
22
|
+
dialogsConfig[name] = false;
|
|
36
23
|
};
|
|
37
24
|
|
|
38
25
|
return {
|
|
39
26
|
dialogsConfig,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
registerDialogCallbacks,
|
|
27
|
+
openDialog,
|
|
28
|
+
closeDialog,
|
|
43
29
|
};
|
|
44
30
|
};
|
|
@@ -6,8 +6,6 @@ import type {
|
|
|
6
6
|
ICustomErrorMessage,
|
|
7
7
|
IErrorMessagesArr,
|
|
8
8
|
} from "../types/forms/types.forms"
|
|
9
|
-
// import { formFieldC12 } from '@/components/forms/c12/utils';
|
|
10
|
-
|
|
11
9
|
// export function useFormControl(name: string = '') {
|
|
12
10
|
export function useFormControl(name: string = "") {
|
|
13
11
|
let savedInitialState = {}
|
package/app/layouts/default.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="page-layout">
|
|
3
|
-
<
|
|
3
|
+
<PageRow tag="div" variant="full" :style-class-passthrough="['header']">
|
|
4
4
|
<template #default>
|
|
5
5
|
<header class="responsive-header">
|
|
6
6
|
<nav class="home-navigation" aria-label="Home Navigation">
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
</ResponsiveHeader>
|
|
38
38
|
</header>
|
|
39
39
|
</template>
|
|
40
|
-
</
|
|
41
|
-
<
|
|
40
|
+
</PageRow>
|
|
41
|
+
<PageRow id="main-content" class="main-content" tag="main" variant="full" :is-landmark="true">
|
|
42
42
|
<template #default>
|
|
43
43
|
<slot name="layout-content">Page content goes here</slot>
|
|
44
44
|
</template>
|
|
45
|
-
</
|
|
46
|
-
<
|
|
45
|
+
</PageRow>
|
|
46
|
+
<PageRow id="footer-content" tag="footer" variant="full" :is-landmark="true">
|
|
47
47
|
<template #default>
|
|
48
48
|
<p>Footer content here</p>
|
|
49
49
|
</template>
|
|
50
|
-
</
|
|
50
|
+
</PageRow>
|
|
51
51
|
</div>
|
|
52
52
|
</template>
|
|
53
53
|
|
|
@@ -103,8 +103,10 @@ const responsiveNavLinks = {
|
|
|
103
103
|
{ name: "Block Decorators", path: "/ui/block-decorators" },
|
|
104
104
|
{ name: "Navigation Horizontal", path: "/ui/navigation/navigation-horizontal" },
|
|
105
105
|
{ name: "Site Navigation", path: "/ui/navigation/site-navigation" },
|
|
106
|
+
{ name: "Tab Navigation", path: "/ui/navigation/tab-navigation" },
|
|
107
|
+
{ name: "Deep Expanding Menu", path: "/ui/deep-expanding-menu" },
|
|
106
108
|
{ name: "Magnetic Navigation", path: "/ui/magnetic-navigation" },
|
|
107
|
-
{ name: "
|
|
109
|
+
{ name: "Page Row", path: "/ui/page-row" },
|
|
108
110
|
{ name: "Layout Grid A", path: "/ui/layout-grid-a" },
|
|
109
111
|
{ name: "Layout Grid B", path: "/ui/layout-grid-b" },
|
|
110
112
|
{ name: "Simple Grid", path: "/ui/simple-grid" },
|
package/app/pages/auto-grid.vue
CHANGED
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<NuxtLayout name="default">
|
|
4
4
|
<template #layout-content>
|
|
5
|
-
|
|
6
|
-
<LayoutRow tag="div" variant="full-width" :style-class-passthrough="['mbe-32']">
|
|
5
|
+
<PageRow tag="div" variant="full" :style-class-passthrough="['mbe-32']">
|
|
7
6
|
<h1 class="page-heading-1">AutoGrid</h1>
|
|
8
7
|
<p class="page-body-normal">
|
|
9
8
|
Responsive auto-fit CSS grid wrapper. Columns auto-fit to a minimum width; when
|
|
10
|
-
<code>is-responsive</code>
|
|
11
|
-
|
|
9
|
+
<code>is-responsive</code>
|
|
10
|
+
is enabled, the minimum shifts at container breakpoints via
|
|
11
|
+
<code>@container</code>
|
|
12
|
+
queries.
|
|
12
13
|
</p>
|
|
13
|
-
</
|
|
14
|
+
</PageRow>
|
|
14
15
|
|
|
15
16
|
<div v-if="isDev" class="qa-panel">
|
|
16
17
|
<details class="qa-panel__details">
|
|
17
18
|
<summary class="qa-panel__summary">
|
|
18
19
|
<span class="qa-panel__title">QA — AutoGrid</span>
|
|
19
20
|
<code class="qa-panel__status">
|
|
20
|
-
tag:{{ qaTag }} · responsive:{{ qaIsResponsive ? "on" : "off" }} · small:{{ qaMinColSizeSmall }} ·
|
|
21
|
+
tag:{{ qaTag }} · responsive:{{ qaIsResponsive ? "on" : "off" }} · small:{{ qaMinColSizeSmall }} ·
|
|
22
|
+
default:{{ qaMinColSizeDefault }} · large:{{ qaMinColSizeLarge }} · gap:{{ qaGap }}
|
|
21
23
|
</code>
|
|
22
24
|
</summary>
|
|
23
25
|
<div class="qa-panel__body">
|
|
24
|
-
|
|
25
26
|
<div class="qa-panel__group">
|
|
26
27
|
<span class="qa-panel__label">tag</span>
|
|
27
28
|
<div class="qa-panel__chips">
|
|
@@ -31,7 +32,9 @@
|
|
|
31
32
|
class="qa-panel__chip"
|
|
32
33
|
:class="{ 'is-active': qaTag === opt }"
|
|
33
34
|
@click="qaTag = opt"
|
|
34
|
-
>
|
|
35
|
+
>
|
|
36
|
+
{{ opt }}
|
|
37
|
+
</button>
|
|
35
38
|
</div>
|
|
36
39
|
</div>
|
|
37
40
|
|
|
@@ -44,7 +47,9 @@
|
|
|
44
47
|
class="qa-panel__chip"
|
|
45
48
|
:class="{ 'is-active': qaIsResponsive === opt }"
|
|
46
49
|
@click="qaIsResponsive = opt"
|
|
47
|
-
>
|
|
50
|
+
>
|
|
51
|
+
{{ opt ? "on" : "off" }}
|
|
52
|
+
</button>
|
|
48
53
|
</div>
|
|
49
54
|
</div>
|
|
50
55
|
|
|
@@ -57,7 +62,9 @@
|
|
|
57
62
|
class="qa-panel__chip"
|
|
58
63
|
:class="{ 'is-active': qaMinColSizeSmall === preset }"
|
|
59
64
|
@click="qaMinColSizeSmall = preset"
|
|
60
|
-
>
|
|
65
|
+
>
|
|
66
|
+
{{ preset }}
|
|
67
|
+
</button>
|
|
61
68
|
</div>
|
|
62
69
|
<input v-model="qaMinColSizeSmall" placeholder="e.g. 200px" class="qa-panel__input" />
|
|
63
70
|
</div>
|
|
@@ -71,7 +78,9 @@
|
|
|
71
78
|
class="qa-panel__chip"
|
|
72
79
|
:class="{ 'is-active': qaMinColSizeDefault === preset }"
|
|
73
80
|
@click="qaMinColSizeDefault = preset"
|
|
74
|
-
>
|
|
81
|
+
>
|
|
82
|
+
{{ preset }}
|
|
83
|
+
</button>
|
|
75
84
|
</div>
|
|
76
85
|
<input v-model="qaMinColSizeDefault" placeholder="e.g. 300px" class="qa-panel__input" />
|
|
77
86
|
</div>
|
|
@@ -85,7 +94,9 @@
|
|
|
85
94
|
class="qa-panel__chip"
|
|
86
95
|
:class="{ 'is-active': qaMinColSizeLarge === preset }"
|
|
87
96
|
@click="qaMinColSizeLarge = preset"
|
|
88
|
-
>
|
|
97
|
+
>
|
|
98
|
+
{{ preset }}
|
|
99
|
+
</button>
|
|
89
100
|
</div>
|
|
90
101
|
<input v-model="qaMinColSizeLarge" placeholder="e.g. 350px" class="qa-panel__input" />
|
|
91
102
|
</div>
|
|
@@ -99,16 +110,17 @@
|
|
|
99
110
|
class="qa-panel__chip"
|
|
100
111
|
:class="{ 'is-active': qaGap === preset }"
|
|
101
112
|
@click="qaGap = preset"
|
|
102
|
-
>
|
|
113
|
+
>
|
|
114
|
+
{{ preset }}
|
|
115
|
+
</button>
|
|
103
116
|
</div>
|
|
104
117
|
<input v-model="qaGap" placeholder="e.g. 2rem" class="qa-panel__input" />
|
|
105
118
|
</div>
|
|
106
|
-
|
|
107
119
|
</div>
|
|
108
120
|
</details>
|
|
109
121
|
</div>
|
|
110
122
|
|
|
111
|
-
<
|
|
123
|
+
<PageRow tag="div" variant="full" :style-class-passthrough="['mbe-32']">
|
|
112
124
|
<div class="auto-grid-demo-container">
|
|
113
125
|
<AutoGrid
|
|
114
126
|
:tag="qaTag"
|
|
@@ -126,8 +138,7 @@
|
|
|
126
138
|
</template>
|
|
127
139
|
</AutoGrid>
|
|
128
140
|
</div>
|
|
129
|
-
</
|
|
130
|
-
|
|
141
|
+
</PageRow>
|
|
131
142
|
</template>
|
|
132
143
|
</NuxtLayout>
|
|
133
144
|
</div>
|
|
@@ -230,7 +241,9 @@ const statCards = [
|
|
|
230
241
|
list-style: none;
|
|
231
242
|
user-select: none;
|
|
232
243
|
|
|
233
|
-
&::-webkit-details-marker {
|
|
244
|
+
&::-webkit-details-marker {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
234
247
|
}
|
|
235
248
|
|
|
236
249
|
.qa-panel__title {
|
|
@@ -287,7 +300,9 @@ const statCards = [
|
|
|
287
300
|
cursor: pointer;
|
|
288
301
|
transition: background 0.15s;
|
|
289
302
|
|
|
290
|
-
&:hover {
|
|
303
|
+
&:hover {
|
|
304
|
+
background: oklch(0% 0 0 / 0.4);
|
|
305
|
+
}
|
|
291
306
|
|
|
292
307
|
&.is-active {
|
|
293
308
|
background: oklch(55% 0.18 240);
|
|
@@ -305,7 +320,9 @@ const statCards = [
|
|
|
305
320
|
border-radius: 0.4rem;
|
|
306
321
|
width: 18rem;
|
|
307
322
|
|
|
308
|
-
&::placeholder {
|
|
323
|
+
&::placeholder {
|
|
324
|
+
opacity: 0.45;
|
|
325
|
+
}
|
|
309
326
|
}
|
|
310
327
|
}
|
|
311
328
|
</style>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:style-class-passthrough="['mbe-32']"
|
|
16
16
|
/>
|
|
17
17
|
|
|
18
|
-
<
|
|
18
|
+
<PageRow tag="div" variant="full">
|
|
19
19
|
<div class="banner-video-demo-controls">
|
|
20
20
|
<p class="demo-controls__heading">Props</p>
|
|
21
21
|
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
/>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
|
-
</
|
|
112
|
+
</PageRow>
|
|
113
113
|
</template>
|
|
114
114
|
</NuxtLayout>
|
|
115
115
|
</div>
|