@nonsuch/component-library 0.5.0 → 0.6.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.
Files changed (45) hide show
  1. package/dist/components/NsAvatar/NsAvatar.vue.d.ts +40 -0
  2. package/dist/components/NsAvatar/index.d.ts +1 -0
  3. package/dist/components/NsBanner/NsBanner.vue.d.ts +30 -0
  4. package/dist/components/NsBanner/index.d.ts +1 -0
  5. package/dist/components/NsButton/NsButton.vue.d.ts +42 -0
  6. package/dist/components/NsButton/index.d.ts +1 -0
  7. package/dist/components/NsCard/NsCard.vue.d.ts +35 -0
  8. package/dist/components/NsCard/index.d.ts +1 -0
  9. package/dist/components/NsCheckbox/NsCheckbox.vue.d.ts +30 -0
  10. package/dist/components/NsCheckbox/index.d.ts +1 -0
  11. package/dist/components/NsChip/NsChip.vue.d.ts +44 -0
  12. package/dist/components/NsChip/index.d.ts +1 -0
  13. package/dist/components/NsDialog/NsDialog.vue.d.ts +42 -0
  14. package/dist/components/NsDialog/index.d.ts +1 -0
  15. package/dist/components/NsForm/NsForm.vue.d.ts +34 -0
  16. package/dist/components/NsForm/index.d.ts +1 -0
  17. package/dist/components/NsInput/NsInput.vue.d.ts +42 -0
  18. package/dist/components/NsInput/index.d.ts +1 -0
  19. package/dist/components/NsList/NsList.vue.d.ts +34 -0
  20. package/dist/components/NsList/index.d.ts +1 -0
  21. package/dist/components/NsSelect/NsSelect.vue.d.ts +59 -0
  22. package/dist/components/NsSelect/index.d.ts +1 -0
  23. package/dist/components/NsSkeleton/NsSkeleton.vue.d.ts +33 -0
  24. package/dist/components/NsSkeleton/index.d.ts +2 -0
  25. package/dist/components/NsThemeProvider/NsThemeProvider.vue.d.ts +36 -0
  26. package/dist/components/NsThemeProvider/index.d.ts +1 -0
  27. package/dist/components/NsToggle/NsToggle.vue.d.ts +30 -0
  28. package/dist/components/NsToggle/index.d.ts +1 -0
  29. package/dist/components/NsTooltip/NsTooltip.vue.d.ts +35 -0
  30. package/dist/components/NsTooltip/index.d.ts +1 -0
  31. package/dist/composables/index.d.ts +4 -0
  32. package/dist/composables/useNsDarkMode.d.ts +37 -0
  33. package/dist/composables/useNsDefaults.d.ts +25 -0
  34. package/dist/composables/useNsLocale.d.ts +28 -0
  35. package/dist/index.d.ts +43 -0
  36. package/dist/locale/NsLocaleMessages.d.ts +58 -0
  37. package/dist/locale/en-CA.d.ts +8 -0
  38. package/dist/locale/fr-CA.d.ts +5 -0
  39. package/dist/locale/index.d.ts +3 -0
  40. package/dist/nonsuch-components.css +1 -1
  41. package/dist/nonsuch-components.js +251 -215
  42. package/dist/plugin.d.ts +42 -0
  43. package/dist/quasarConfig.d.ts +41 -0
  44. package/dist/tokens/index.d.ts +20 -0
  45. package/package.json +5 -3
@@ -0,0 +1,42 @@
1
+ import type { Plugin } from 'vue';
2
+ import type { NsLocaleMessages } from './locale/NsLocaleMessages';
3
+ /**
4
+ * Options accepted by the `createNonsuch()` plugin.
5
+ *
6
+ * Every option has a sensible default — calling `app.use(createNonsuch())`
7
+ * with no arguments is valid and gives you English (Canada) strings.
8
+ */
9
+ export interface NsPluginOptions {
10
+ /**
11
+ * Locale messages provided to all Ns components.
12
+ * @default nsLocaleEnCA
13
+ */
14
+ locale?: NsLocaleMessages;
15
+ }
16
+ /**
17
+ * Create the Nonsuch component-library Vue plugin.
18
+ *
19
+ * This is the recommended one-line setup for consuming apps:
20
+ *
21
+ * ```ts
22
+ * import { createApp } from 'vue'
23
+ * import { Quasar } from 'quasar'
24
+ * import { createNonsuch } from '@nonsuch/component-library'
25
+ * import '@nonsuch/component-library/tokens.css'
26
+ *
27
+ * const app = createApp(App)
28
+ * app.use(Quasar, { plugins: {} })
29
+ * app.use(createNonsuch())
30
+ * ```
31
+ *
32
+ * With options:
33
+ *
34
+ * ```ts
35
+ * import { createNonsuch, nsLocaleFrCA } from '@nonsuch/component-library'
36
+ *
37
+ * app.use(createNonsuch({
38
+ * locale: nsLocaleFrCA,
39
+ * }))
40
+ * ```
41
+ */
42
+ export declare function createNonsuch(options?: NsPluginOptions): Plugin;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Create a Quasar framework config with Nonsuch brand colours.
3
+ *
4
+ * Bridges the CSS token system with Quasar's runtime brand colours
5
+ * so that Quasar's built-in colour classes (`.bg-primary`, etc.)
6
+ * match the Nonsuch palette.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import { Quasar } from 'quasar'
11
+ * import { createQuasarConfig } from '@nonsuch/component-library'
12
+ *
13
+ * app.use(Quasar, createQuasarConfig())
14
+ * ```
15
+ *
16
+ * With overrides:
17
+ *
18
+ * ```ts
19
+ * app.use(Quasar, createQuasarConfig({
20
+ * brand: { primary: '#custom' },
21
+ * plugins: { Notify: {} },
22
+ * }))
23
+ * ```
24
+ */
25
+ export interface QuasarBrandColors {
26
+ primary?: string;
27
+ secondary?: string;
28
+ accent?: string;
29
+ dark?: string;
30
+ 'dark-page'?: string;
31
+ positive?: string;
32
+ negative?: string;
33
+ info?: string;
34
+ warning?: string;
35
+ }
36
+ export interface QuasarConfigOverrides {
37
+ brand?: QuasarBrandColors;
38
+ plugins?: Record<string, unknown>;
39
+ [key: string]: unknown;
40
+ }
41
+ export declare function createQuasarConfig(overrides?: QuasarConfigOverrides): Record<string, unknown>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Nonsuch Design Tokens
3
+ *
4
+ * Re-exports the token stylesheet and provides TypeScript
5
+ * helpers for type-safe token access in JavaScript.
6
+ */
7
+ /** All available Nonsuch token names. */
8
+ export type NsToken = '--ns-color-primary' | '--ns-color-primary-hover' | '--ns-color-secondary' | '--ns-color-secondary-hover' | '--ns-color-accent' | '--ns-color-accent-hover' | '--ns-color-success' | '--ns-color-warning' | '--ns-color-error' | '--ns-color-info' | '--ns-color-background' | '--ns-color-surface' | '--ns-color-surface-variant' | '--ns-color-on-primary' | '--ns-color-on-secondary' | '--ns-color-on-accent' | '--ns-color-on-background' | '--ns-color-on-surface' | '--ns-color-neutral-50' | '--ns-color-neutral-100' | '--ns-color-neutral-200' | '--ns-color-neutral-300' | '--ns-color-neutral-400' | '--ns-color-neutral-500' | '--ns-color-neutral-600' | '--ns-color-neutral-700' | '--ns-color-neutral-800' | '--ns-color-neutral-900' | '--ns-font-family-text' | '--ns-font-family-display' | '--ns-font-size-xs' | '--ns-font-size-sm' | '--ns-font-size-md' | '--ns-font-size-lg' | '--ns-font-size-xl' | '--ns-font-size-2xl' | '--ns-font-size-3xl' | '--ns-font-weight-regular' | '--ns-font-weight-medium' | '--ns-font-weight-semibold' | '--ns-font-weight-bold' | '--ns-line-height-tight' | '--ns-line-height-normal' | '--ns-line-height-relaxed' | '--ns-letter-spacing-tight' | '--ns-letter-spacing-normal' | '--ns-letter-spacing-wide' | '--ns-space-1' | '--ns-space-2' | '--ns-space-3' | '--ns-space-4' | '--ns-space-5' | '--ns-space-6' | '--ns-space-8' | '--ns-space-10' | '--ns-space-12' | '--ns-space-16' | '--ns-radius-none' | '--ns-radius-sm' | '--ns-radius-md' | '--ns-radius-lg' | '--ns-radius-xl' | '--ns-radius-full' | '--ns-shadow-sm' | '--ns-shadow-md' | '--ns-shadow-lg' | '--ns-shadow-xl' | '--ns-duration-fast' | '--ns-duration-normal' | '--ns-duration-slow' | '--ns-easing-default' | '--ns-easing-in' | '--ns-easing-out' | '--ns-easing-in-out';
9
+ /**
10
+ * Read a design token value from the computed styles of an element.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { getToken } from '@nonsuch/component-library'
15
+ *
16
+ * const primary = getToken('--ns-color-primary')
17
+ * // → '#3b82f6'
18
+ * ```
19
+ */
20
+ export declare function getToken(name: NsToken, el?: Element): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nonsuch/component-library",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A Vue 3 component library built on Quasar with opinionated defaults and custom components.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "scripts": {
32
32
  "dev": "storybook dev -p 6006",
33
- "build": "vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly",
33
+ "build": "vite build && rm -f tsconfig.build.tsbuildinfo && vue-tsc -p tsconfig.build.json --emitDeclarationOnly",
34
34
  "build:storybook": "storybook build",
35
35
  "typecheck": "vue-tsc -p tsconfig.app.json --noEmit",
36
36
  "lint": "eslint .",
@@ -60,9 +60,10 @@
60
60
  ]
61
61
  },
62
62
  "devDependencies": {
63
- "@eslint/js": "^9.39.2",
63
+ "@eslint/js": "^10.0.1",
64
64
  "@quasar/extras": "^1.17.0",
65
65
  "@quasar/vite-plugin": "^1.10.0",
66
+ "@storybook/addon-a11y": "^10.2.10",
66
67
  "@storybook/vue3-vite": "^10.2.7",
67
68
  "@vitejs/plugin-vue": "^6.0.4",
68
69
  "@vitest/coverage-v8": "^4.0.18",
@@ -70,6 +71,7 @@
70
71
  "eslint": "^10.0.0",
71
72
  "eslint-config-prettier": "^10.1.8",
72
73
  "eslint-plugin-vue": "^10.7.0",
74
+ "eslint-plugin-vuejs-accessibility": "^2.5.0",
73
75
  "happy-dom": "^20.5.3",
74
76
  "husky": "^9.1.7",
75
77
  "lint-staged": "^16.2.7",