@nonsuch/component-library 0.7.0 → 0.7.1

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/README.md CHANGED
@@ -224,6 +224,45 @@ All tokens use the `--ns-` prefix and support light/dark mode automatically. Cur
224
224
 
225
225
  Dark mode activates via `class="dark"`, `data-theme="dark"`, Quasar's `.q-dark`, or `prefers-color-scheme: dark`.
226
226
 
227
+ ### Breakpoints
228
+
229
+ The library ships Quasar-aligned breakpoint values and media-query helpers:
230
+
231
+ ```ts
232
+ import {
233
+ nsBreakpoints,
234
+ nsMediaUp,
235
+ nsMediaDown,
236
+ nsMediaOnly,
237
+ nsMediaBetween,
238
+ } from '@nonsuch/component-library'
239
+ ```
240
+
241
+ | Name | Min-width | Range | Note |
242
+ | ---- | --------- | -------------- | ----- |
243
+ | xs | 0 | 0 – 599 px | |
244
+ | sm | 600 | 600 – 1023 px | |
245
+ | md | 1024 | 1024 – 1439 px | |
246
+ | lg | 1440 | 1440 – 1919 px | |
247
+ | xl | 1920 | 1920 – 2559 px | |
248
+ | xxl | 2560 | 2560 – 3839 px | 1440p |
249
+ | xxxl | 3840 | 3840 px + | 4K |
250
+
251
+ Media-query helpers return `matchMedia()`-ready strings:
252
+
253
+ ```ts
254
+ nsMediaUp('md') // '(min-width: 1024px)'
255
+ nsMediaDown('md') // '(max-width: 1023px)'
256
+ nsMediaOnly('md') // '(min-width: 1024px) and (max-width: 1439px)'
257
+ nsMediaBetween('sm', 'lg') // '(min-width: 600px) and (max-width: 1919px)'
258
+ ```
259
+
260
+ To customize in the future, spread and override:
261
+
262
+ ```ts
263
+ const custom = { ...nsBreakpoints, lg: 1280 }
264
+ ```
265
+
227
266
  ## Development
228
267
 
229
268
  ```bash
@@ -249,29 +288,65 @@ pnpm build:storybook
249
288
  ```text
250
289
  src/
251
290
  index.ts # Library entry — exports all public API
291
+ manifest.ts # Quasar → Ns component mapping for sync enforcement
252
292
  plugin.ts # createNonsuch() Vue plugin
253
293
  quasarConfig.ts # createQuasarConfig() helper
254
294
  components/
255
295
  NsAvatar/ # Avatar with size presets
296
+ NsBadge/ # Styled QBadge wrapper
256
297
  NsBanner/ # Info/success/warning/error banners
298
+ NsBreadcrumbs/ # Breadcrumb navigation
299
+ NsBreadcrumbElement/ # Individual breadcrumb item
257
300
  NsButton/ # Styled QBtn wrapper
301
+ NsButtonToggle/ # Toggle between button options
258
302
  NsCard/ # Card with title/subtitle/actions slots
303
+ NsCardActions/ # Card action bar
304
+ NsCardSection/ # Card content section
259
305
  NsCheckbox/ # Styled QCheckbox wrapper
260
306
  NsChip/ # Tag/filter chip
261
307
  NsDialog/ # Modal dialog with header/body/actions
308
+ NsFooter/ # App footer (within NsLayout)
262
309
  NsForm/ # Form wrapper with validation
310
+ NsHeader/ # App header (within NsLayout)
311
+ NsIcon/ # Styled QIcon wrapper
312
+ NsImage/ # Styled QImg wrapper
313
+ NsInnerLoading/ # Overlay loading indicator
263
314
  NsInput/ # Styled QInput wrapper
315
+ NsItem/ # List item
316
+ NsItemLabel/ # List item label
317
+ NsItemSection/ # List item section
318
+ NsLayout/ # App layout container
319
+ NsLinearProgress/ # Linear progress bar
264
320
  NsList/ # List with separator defaults
321
+ NsMenu/ # Dropdown/context menu
322
+ NsPage/ # Page content area
323
+ NsPageContainer/ # Page container (within NsLayout)
324
+ NsPagination/ # Page navigation controls
265
325
  NsSelect/ # Styled QSelect dropdown
326
+ NsSeparator/ # Horizontal/vertical separator
266
327
  NsSkeleton/ # Loading skeleton with animation
328
+ NsSpace/ # Flex spacer
329
+ NsSpinner/ # Circular spinner
330
+ NsSpinnerDots/ # Dot-style spinner
331
+ NsTab/ # Tab item (within NsTabs)
332
+ NsTabPanel/ # Tab panel content
333
+ NsTabPanels/ # Tab panels container
334
+ NsTable/ # Data table
335
+ NsTableCell/ # Table cell
336
+ NsTabs/ # Tab navigation bar
267
337
  NsThemeProvider/ # Renderless locale provider
338
+ NsTimeline/ # Timeline container
339
+ NsTimelineEntry/ # Timeline entry item
268
340
  NsToggle/ # Styled QToggle switch
341
+ NsToolbar/ # Toolbar container
342
+ NsToolbarTitle/ # Toolbar title
269
343
  NsTooltip/ # Tooltip with consistent delays
270
344
  composables/
271
345
  useNsLocale.ts # Locale injection/provision
272
346
  useNsDarkMode.ts # Dark mode with persistence
273
347
  useNsDefaults.ts # Default value helper
274
348
  locale/ # en-CA, fr-CA string packs
349
+ breakpoints/ # Breakpoint values + media query helpers
275
350
  tokens/ # Design token CSS + TS helpers
276
351
  fonts/ # Fixel font files + CSS
277
352
  ```
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Nonsuch Breakpoints
3
+ *
4
+ * Adopts Quasar's breakpoint scale as the library default.
5
+ * Values are customizable — update `nsBreakpoints` if Nonsuch
6
+ * needs to diverge from Quasar in the future.
7
+ *
8
+ * @see https://quasar.dev/style/breakpoints
9
+ */
10
+ /** Named breakpoint sizes. */
11
+ export type NsBreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl';
12
+ /**
13
+ * Minimum widths (in pixels) for each breakpoint.
14
+ *
15
+ * | Name | Min-width | Range |
16
+ * |------|-----------|------------------|
17
+ * | xs | 0 | 0 – 599 px |
18
+ * | sm | 600 | 600 – 1023 px |
19
+ * | md | 1024 | 1024 – 1439 px |
20
+ * | lg | 1440 | 1440 – 1919 px |
21
+ * | xl | 1920 | 1920 – 2559 px |
22
+ * | xxl | 2560 | 2560 – 3839 px | (1440p)
23
+ * | xxxl | 3840 | 3840 px + | (4K)
24
+ *
25
+ * These match Quasar's defaults. To customize, spread and override:
26
+ * ```ts
27
+ * const custom = { ...nsBreakpoints, lg: 1280 }
28
+ * ```
29
+ */
30
+ export declare const nsBreakpoints: Record<NsBreakpointName, number>;
31
+ /** Ordered list of breakpoint names from smallest to largest. */
32
+ export declare const nsBreakpointNames: readonly NsBreakpointName[];
33
+ /**
34
+ * Generate a `min-width` media query string for the given breakpoint.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * nsMediaUp('md') // → '(min-width: 1024px)'
39
+ * ```
40
+ */
41
+ export declare function nsMediaUp(name: NsBreakpointName): string;
42
+ /**
43
+ * Generate a `max-width` media query string for the breakpoint
44
+ * immediately *below* the given one.
45
+ *
46
+ * Useful for targeting everything smaller than a breakpoint.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * nsMediaDown('md') // → '(max-width: 1023px)' — everything below md
51
+ * ```
52
+ */
53
+ export declare function nsMediaDown(name: Exclude<NsBreakpointName, 'xs'>): string;
54
+ /**
55
+ * Generate a media query string matching exactly one breakpoint range.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * nsMediaOnly('md') // → '(min-width: 1024px) and (max-width: 1439px)'
60
+ * nsMediaOnly('xl') // → '(min-width: 1920px)'
61
+ * ```
62
+ */
63
+ export declare function nsMediaOnly(name: NsBreakpointName): string;
64
+ /**
65
+ * Generate a media query for a range between two breakpoints (inclusive).
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * nsMediaBetween('sm', 'lg') // → '(min-width: 600px) and (max-width: 1919px)'
70
+ * ```
71
+ */
72
+ export declare function nsMediaBetween(from: NsBreakpointName, to: NsBreakpointName): string;
package/dist/index.d.ts CHANGED
@@ -109,4 +109,6 @@ export { useNsDarkMode } from './composables/useNsDarkMode';
109
109
  export type { UseNsDarkModeReturn } from './composables/useNsDarkMode';
110
110
  export type { NsToken } from './tokens';
111
111
  export { getToken } from './tokens';
112
+ export type { NsBreakpointName } from './breakpoints';
113
+ export { nsBreakpoints, nsBreakpointNames, nsMediaUp, nsMediaDown, nsMediaOnly, nsMediaBetween, } from './breakpoints';
112
114
  export { nsComponentManifest, nsTemplateTagManifest, generateQuasarBanRules } from './manifest';