iryx-ui 0.7.0 → 0.9.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 (33) hide show
  1. package/README.md +155 -7
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/components/BarChart.vue.d.ts +36 -0
  4. package/dist/components/FileUpload.vue.d.ts +64 -0
  5. package/dist/components/Sparkline.vue.d.ts +38 -0
  6. package/dist/components/index.d.ts +3 -0
  7. package/dist/composables/element-size.d.ts +15 -0
  8. package/dist/composables/scale.d.ts +36 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.js +78 -70
  11. package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +86 -7
  12. package/dist/packages/iryx-ui/src/component-names.js +1 -1
  13. package/dist/packages/iryx-ui/src/components/BarChart.js +5 -0
  14. package/dist/packages/iryx-ui/src/components/BarChart.vue_vue_type_script_setup_true_lang.js +178 -0
  15. package/dist/packages/iryx-ui/src/components/FileUpload.js +5 -0
  16. package/dist/packages/iryx-ui/src/components/FileUpload.vue_vue_type_script_setup_true_lang.js +209 -0
  17. package/dist/packages/iryx-ui/src/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +9 -9
  18. package/dist/packages/iryx-ui/src/components/Sparkline.js +5 -0
  19. package/dist/packages/iryx-ui/src/components/Sparkline.vue_vue_type_script_setup_true_lang.js +110 -0
  20. package/dist/packages/iryx-ui/src/components/index.js +72 -66
  21. package/dist/packages/iryx-ui/src/composables/element-size.js +22 -0
  22. package/dist/packages/iryx-ui/src/composables/scale.js +43 -0
  23. package/dist/packages/iryx-ui/src/theme/bar-chart.js +18 -0
  24. package/dist/packages/iryx-ui/src/theme/file-upload.js +29 -0
  25. package/dist/packages/iryx-ui/src/theme/password-input.js +1 -0
  26. package/dist/packages/iryx-ui/src/theme/sparkline.js +15 -0
  27. package/dist/theme/bar-chart.d.ts +111 -0
  28. package/dist/theme/file-upload.d.ts +143 -0
  29. package/dist/theme/form.d.ts +3 -3
  30. package/dist/theme/index.d.ts +3 -0
  31. package/dist/theme/password-input.d.ts +18 -0
  32. package/dist/theme/sparkline.d.ts +58 -0
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -199,21 +199,20 @@ For a static re-brand, plain CSS works too — tokens are just variables:
199
199
 
200
200
  ### Typeface
201
201
 
202
- The library ships **no webfont** — that would put font files, a licence and a
203
- network request into every app whether it wanted them or not. It reads one
204
- variable, defaulting to the system stack. Point it at your own family and
205
- everything follows, including Tailwind's `font-sans`:
202
+ Set `--iryx-font-sans` and everything follows, including Tailwind's
203
+ `font-sans`. Load the family however you like a package, a `<link>`, or
204
+ self-hosted:
206
205
 
207
206
  ```css
208
- @import "@fontsource-variable/instrument-sans"; /* or a <link>, or self-hosted */
207
+ @import "@fontsource-variable/instrument-sans";
209
208
 
210
209
  :root {
211
210
  --iryx-font-sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
212
211
  }
213
212
  ```
214
213
 
215
- Unlike the colour tokens, this one is not mode-specific — there is no `.dark`
216
- counterpart to keep in sync.
214
+ Leave it unset to use the system stack. There is no `.dark` counterpart for
215
+ this one.
217
216
 
218
217
  Available tokens, each usable as a Tailwind color (`bg-primary`,
219
218
  `text-muted-foreground`, …):
@@ -290,6 +289,9 @@ app.use(createIryxUi({ unstyled: true }))
290
289
  | `IFormField` | Label, description, hint, help and error text around a control |
291
290
  | `IInput` | Text field with `sm`/`md`/`lg` sizes, `invalid` state, `v-model`, `leading`/`trailing` slots, `clearable`, `loading`, `debounce` |
292
291
  | `INumberInput` | Decimal-safe numeric field — the model is a **string**, with `min`/`max`/`step`, `precision` and locale-aware display |
292
+ | `ISparkline` | Tiny inline trend chart — pure SVG, no charting dependency |
293
+ | `IBarChart` | Categorical bar chart with a round-number axis, hover tooltip and a table view |
294
+ | `IFileUpload` | Drag-and-drop file field with `accept` / `maxSize` / `maxFiles`, thumbnails and a remove action |
293
295
  | `IDatePicker` | Calendar in a popover; the model is an ISO `YYYY-MM-DD` **string** |
294
296
  | `IDateRangePicker` | Two-month range calendar; the model is `{ start, end }` ISO strings |
295
297
  | `IPasswordInput` | Masked field with a show/hide toggle and an optional strength meter |
@@ -480,6 +482,152 @@ chrome; use `ui` to reach the parts (`root`, `input`, `leading`, `trailing`,
480
482
  forwarded to the `<input>` itself. `ref` exposes the element as `.input` for
481
483
  focus management.
482
484
 
485
+ #### Bar charts
486
+
487
+ ```vue
488
+ <IBarChart
489
+ :data="[
490
+ { label: 'Jan', value: 4200 },
491
+ { label: 'Feb', value: 5600 },
492
+ { label: 'Mar', value: null },
493
+ ]"
494
+ label="Revenue by month"
495
+ locale="de-DE"
496
+ :format="{ style: 'currency', currency: 'EUR', maximumFractionDigits: 0 }"
497
+ />
498
+ ```
499
+
500
+ | Prop | Effect |
501
+ | --- | --- |
502
+ | `data` | `{ label, value }[]`. `value: null` is a **missing reading** — no bar, which is not a zero |
503
+ | `height` | Rendered height in px (default 240). Width fills the container |
504
+ | `ticks` | Target tick count. A hint — the axis lands on round numbers first |
505
+ | `axis` | Set `false` to drop the value axis and gridlines |
506
+ | `locale` / `format` | `Intl.NumberFormat` settings, applied to ticks and tooltip alike |
507
+ | `label` | Accessible name for the figure |
508
+
509
+ **The axis picks the domain, not the data.** Values are snapped outwards to a
510
+ 1/2/5 step, so an axis reads `0 / 2,000 / 4,000` rather than `0 / 1,726.8`.
511
+ Zero is always included, because bars are compared by length and a truncated
512
+ baseline makes that comparison a lie.
513
+
514
+ Bars are capped at 24px and never fill their slot — the gap between them is
515
+ what separates them. They're rounded at the data end and square at the
516
+ baseline, so the rounding reads as the tip of the value.
517
+
518
+ Hovering a bar dims the rest and shows a tooltip; hit targets span the full
519
+ band and plot height, so a short bar is no harder to hit than a tall one.
520
+
521
+ **Accessibility:** the SVG is `aria-hidden` and the data is exposed as a
522
+ visually-hidden table instead, so a screen reader gets the actual numbers
523
+ rather than a blank graphic. That table renders even before the container has
524
+ been measured — the data is never gated behind layout.
525
+
526
+ Long category labels thin out to every *n*th rather than rotating or
527
+ colliding. For many categories or long names, that's the honest limit of this
528
+ chart — reach for a table.
529
+
530
+ #### Sparklines
531
+
532
+ A trend at a glance, for a stat tile or a table cell. Plain SVG — no charting
533
+ library, no canvas, nothing to install.
534
+
535
+ ```vue
536
+ <ISparkline
537
+ :data="[4200, 4600, 4100, 5200, 5800, 6300]"
538
+ variant="area"
539
+ end-dot
540
+ label="Revenue over six months, trending up"
541
+ />
542
+ ```
543
+
544
+ Because it is SVG, colour comes from `currentColor`: recolour it with a text
545
+ utility, and it follows your theme preset and light/dark automatically with no
546
+ JavaScript. A canvas chart cannot read CSS variables, so it would need a
547
+ re-render on every theme change.
548
+
549
+ | Prop | Effect |
550
+ | --- | --- |
551
+ | `data` | Values, oldest first. `null` is a **gap**, not a zero — the line breaks |
552
+ | `variant` | `line` (default) or `area`, which adds a wash beneath the line |
553
+ | `endDot` | Marks the most recent point |
554
+ | `baseline` | Lower edge of the `area` wash: `min` (default) or `zero` |
555
+ | `min` / `max` | Pin the domain — set both to put several sparklines on one scale |
556
+ | `muted` | Draw in muted ink, for a de-emphasised trend |
557
+ | `height` | Rendered height in px (default 32). Width always fills the container |
558
+
559
+ Width is fluid and the stroke never distorts: the drawing stretches via
560
+ `preserveAspectRatio="none"`, while every stroke carries
561
+ `vector-effect="non-scaling-stroke"`, so a 2px line stays 2px and the end dot
562
+ stays circular at any aspect ratio.
563
+
564
+ `label` sets an accessible description. **Without one the sparkline is hidden
565
+ from assistive tech as decorative** — which is correct when it sits beside a
566
+ value that already states the number, and wrong if it is the only thing
567
+ carrying the information.
568
+
569
+ Edge cases behave: an empty series draws nothing, a flat series draws through
570
+ the middle rather than collapsing to an edge, and a single reading is a dot.
571
+
572
+ The scale helpers are exported for building your own marks:
573
+
574
+ ```ts
575
+ import { extent, linearScale } from 'iryx-ui'
576
+
577
+ extent([3, null, 9, 1]) // [1, 9] — gaps ignored
578
+ linearScale([0, 10], [100, 0])(10) // 0 — ranges may be inverted for SVG's y-axis
579
+ ```
580
+
581
+ #### Files
582
+
583
+ ```vue
584
+ <script setup lang="ts">
585
+ import { ref } from 'vue'
586
+
587
+ const logo = ref<File[]>([])
588
+ </script>
589
+
590
+ <template>
591
+ <IFileUpload
592
+ v-model="logo"
593
+ accept="image/*"
594
+ :max-size="2 * 1024 * 1024"
595
+ label="Drag your logo here"
596
+ browse-label="Browse images"
597
+ hint="PNG, JPG or SVG up to 2 MB"
598
+ @reject="onReject"
599
+ />
600
+ </template>
601
+ ```
602
+
603
+ The model is **always a `File[]`**, even without `multiple` — a `File | File[]`
604
+ union would make every caller narrow the type before touching it, and the
605
+ single case is just an array holding at most one. Without `multiple`, picking
606
+ again replaces rather than appends.
607
+
608
+ | Prop | Effect |
609
+ | --- | --- |
610
+ | `multiple` | Accept more than one file |
611
+ | `accept` | Native syntax: `image/*`, `.pdf`, `image/png` |
612
+ | `maxSize` | Largest accepted size, in bytes |
613
+ | `maxFiles` | Cap on how many files may be held at once |
614
+ | `label` | Prompt in the zone, above the hint |
615
+ | `browseLabel` | Text on the browse button |
616
+ | `hint` | Fine print under the prompt — the accepted types belong here |
617
+
618
+ Every string is a prop, including `removeLabel` and the three rejection
619
+ messages, so nothing bakes in English.
620
+
621
+ `accept` is enforced in the component as well as on the input, because a
622
+ dragged-in file bypasses the native filter entirely. Refused files raise
623
+ `@reject` with `{ file, reason }` — `'type'`, `'size'` or `'count'` — so you
624
+ can word your own message; the built-in text is available through the
625
+ `tooLargeText`, `wrongTypeText` and `tooManyText` props.
626
+
627
+ Image files get a thumbnail, anything else a placeholder of the same size so
628
+ rows stay aligned. The object URLs behind those thumbnails are revoked as soon
629
+ as a file leaves the list or the component unmounts.
630
+
483
631
  #### Dates
484
632
 
485
633
  The model is an ISO `YYYY-MM-DD` **string**, never a `Date`.
@@ -3,5 +3,5 @@
3
3
  * Consumed by the Vue plugin (global registration) and the Nuxt module
4
4
  * (auto-imports). Keep in sync with `src/components/index.ts`.
5
5
  */
6
- export declare const componentNames: readonly ["Alert", "App", "Badge", "Banner", "Breadcrumb", "Button", "ButtonGroup", "Card", "Checkbox", "Combobox", "ConfirmDialog", "DatePicker", "DateRangePicker", "Dialog", "DropdownMenu", "EmptyState", "Form", "FormField", "Input", "Label", "NumberInput", "Pagination", "PasswordInput", "Progress", "RadioGroup", "Select", "Separator", "Skeleton", "Stat", "Stepper", "Switch", "Table", "Tabs", "Textarea", "Toaster", "Tooltip"];
6
+ export declare const componentNames: readonly ["Alert", "App", "Badge", "BarChart", "Banner", "Breadcrumb", "Button", "ButtonGroup", "Card", "Checkbox", "Combobox", "ConfirmDialog", "DatePicker", "DateRangePicker", "Dialog", "DropdownMenu", "EmptyState", "FileUpload", "Form", "FormField", "Input", "Label", "NumberInput", "Pagination", "PasswordInput", "Progress", "RadioGroup", "Select", "Separator", "Skeleton", "Sparkline", "Stat", "Stepper", "Switch", "Table", "Tabs", "Textarea", "Toaster", "Tooltip"];
7
7
  export type ComponentName = (typeof componentNames)[number];
@@ -0,0 +1,36 @@
1
+ import type { SparseValue } from '../composables/scale';
2
+ export interface BarChartDatum {
3
+ label: string;
4
+ /** `null` is a missing reading — no bar is drawn, which is not the same as 0. */
5
+ value: SparseValue;
6
+ }
7
+ export interface BarChartProps {
8
+ data?: readonly BarChartDatum[];
9
+ /** Rendered height in px. Width always fills the container. */
10
+ height?: number;
11
+ /** Target tick count. The axis lands on round numbers, so this is a hint. */
12
+ ticks?: number;
13
+ /** Drop the value axis and its gridlines. */
14
+ axis?: boolean;
15
+ /** Locale and options for every number shown — ticks and tooltip alike. */
16
+ locale?: string;
17
+ format?: Intl.NumberFormatOptions;
18
+ /**
19
+ * Accessible name for the figure. The bars are hidden from assistive tech
20
+ * and the data is exposed as a table instead, so this names what that is.
21
+ */
22
+ label?: string;
23
+ /** Skip built-in classes; you take over styling entirely. */
24
+ unstyled?: boolean;
25
+ class?: string;
26
+ ui?: Partial<Record<'root' | 'svg' | 'grid' | 'tick' | 'category' | 'bar' | 'tooltip' | 'tooltipLabel' | 'tooltipValue' | 'table', string>>;
27
+ }
28
+ declare const __VLS_export: import("vue").DefineComponent<BarChartProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BarChartProps> & Readonly<{}>, {
29
+ unstyled: boolean;
30
+ data: readonly BarChartDatum[];
31
+ height: number;
32
+ ticks: number;
33
+ axis: boolean;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
@@ -0,0 +1,64 @@
1
+ /** Why a file was turned away, so the caller can word its own message. */
2
+ export interface FileRejection {
3
+ file: File;
4
+ reason: 'type' | 'size' | 'count';
5
+ }
6
+ export interface FileUploadProps {
7
+ /** Accept more than one file. The model is an array either way. */
8
+ multiple?: boolean;
9
+ /** Same syntax as the native attribute: `image/*`, `.pdf`, `image/png`. */
10
+ accept?: string;
11
+ /** Largest accepted size, in bytes. */
12
+ maxSize?: number;
13
+ /** Cap on how many files may be held at once. */
14
+ maxFiles?: number;
15
+ disabled?: boolean;
16
+ /** Mark the field as invalid — styles the border and ring red. */
17
+ invalid?: boolean;
18
+ id?: string;
19
+ /** Prompt inside the drop zone. */
20
+ label?: string;
21
+ /** Secondary line under the prompt — good place for the accepted types. */
22
+ hint?: string;
23
+ /** Text on the browse button. */
24
+ browseLabel?: string;
25
+ /** Labels and messages — override for non-English apps. */
26
+ removeLabel?: string;
27
+ tooLargeText?: string;
28
+ wrongTypeText?: string;
29
+ tooManyText?: string;
30
+ /** Skip built-in classes; you take over styling entirely. */
31
+ unstyled?: boolean;
32
+ /** Applied to the outer wrapper, which stacks the zone above the list. */
33
+ class?: string;
34
+ /** Override classes per slot, e.g. `{ dropzone: 'py-10' }`. */
35
+ ui?: Partial<Record<'root' | 'dropzone' | 'input' | 'icon' | 'label' | 'browse' | 'hint' | 'list' | 'item' | 'thumbnail' | 'placeholder' | 'details' | 'name' | 'meta' | 'remove' | 'error', string>>;
36
+ }
37
+ type __VLS_Props = FileUploadProps;
38
+ type __VLS_ModelProps = {
39
+ /**
40
+ * Always an array, even when `multiple` is false — a `File | File[]` union
41
+ * would make every caller narrow the type before touching it, and the single
42
+ * case is just an array that holds at most one.
43
+ */
44
+ modelValue?: File[];
45
+ };
46
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
47
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
+ "update:modelValue": (value: File[]) => any;
49
+ reject: (rejections: FileRejection[]) => any;
50
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
51
+ "onUpdate:modelValue"?: ((value: File[]) => any) | undefined;
52
+ onReject?: ((rejections: FileRejection[]) => any) | undefined;
53
+ }>, {
54
+ unstyled: boolean;
55
+ label: string;
56
+ invalid: boolean;
57
+ browseLabel: string;
58
+ removeLabel: string;
59
+ tooLargeText: string;
60
+ wrongTypeText: string;
61
+ tooManyText: string;
62
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
63
+ declare const _default: typeof __VLS_export;
64
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import type { SparseValue } from '../composables/scale';
2
+ export interface SparklineProps {
3
+ /** Values, oldest first. `null` is a gap in the series, not a zero. */
4
+ data?: readonly SparseValue[];
5
+ /** `area` adds a wash beneath the same line. */
6
+ variant?: 'line' | 'area';
7
+ /** Mark the most recent point with a dot. */
8
+ endDot?: boolean;
9
+ /** Lower edge of the `area` wash. */
10
+ baseline?: 'min' | 'zero';
11
+ /** Pin the domain — set both to put several sparklines on one scale. */
12
+ min?: number;
13
+ max?: number;
14
+ /** Draw in muted ink, for the de-emphasised trend inside a stat tile. */
15
+ muted?: boolean;
16
+ /**
17
+ * Accessible description of the trend. Without one the sparkline is treated
18
+ * as decorative and hidden from assistive tech — which is correct when it
19
+ * sits beside a value that already states the number.
20
+ */
21
+ label?: string;
22
+ /** Rendered height in px. Width always fills the container. */
23
+ height?: number;
24
+ /** Skip built-in classes; you take over styling entirely. */
25
+ unstyled?: boolean;
26
+ class?: string;
27
+ /** Override classes per slot, e.g. `{ line: 'stroke-[3]' }`. */
28
+ ui?: Partial<Record<'root' | 'plot' | 'line' | 'area' | 'dot' | 'ring', string>>;
29
+ }
30
+ declare const __VLS_export: import("vue").DefineComponent<SparklineProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SparklineProps> & Readonly<{}>, {
31
+ variant: "line" | "area";
32
+ unstyled: boolean;
33
+ data: readonly SparseValue[];
34
+ height: number;
35
+ baseline: "min" | "zero";
36
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
@@ -2,6 +2,7 @@ export { default as Alert } from './Alert.vue';
2
2
  export { default as App } from './App.vue';
3
3
  export { default as Badge } from './Badge.vue';
4
4
  export { default as Banner } from './Banner.vue';
5
+ export { default as BarChart } from './BarChart.vue';
5
6
  export { default as Breadcrumb } from './Breadcrumb.vue';
6
7
  export { default as Button } from './Button.vue';
7
8
  export { default as ButtonGroup } from './ButtonGroup.vue';
@@ -14,6 +15,7 @@ export { default as DateRangePicker } from './DateRangePicker.vue';
14
15
  export { default as Dialog } from './Dialog.vue';
15
16
  export { default as DropdownMenu } from './DropdownMenu.vue';
16
17
  export { default as EmptyState } from './EmptyState.vue';
18
+ export { default as FileUpload } from './FileUpload.vue';
17
19
  export { default as Form } from './Form.vue';
18
20
  export { default as FormField } from './FormField.vue';
19
21
  export { default as Input } from './Input.vue';
@@ -26,6 +28,7 @@ export { default as RadioGroup } from './RadioGroup.vue';
26
28
  export { default as Select } from './Select.vue';
27
29
  export { default as Separator } from './Separator.vue';
28
30
  export { default as Skeleton } from './Skeleton.vue';
31
+ export { default as Sparkline } from './Sparkline.vue';
29
32
  export { default as Stat } from './Stat.vue';
30
33
  export { default as Stepper } from './Stepper.vue';
31
34
  export { default as Switch } from './Switch.vue';
@@ -0,0 +1,15 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Track an element's rendered width.
4
+ *
5
+ * A sparkline can stretch a fixed box because strokes opt out of the scaling.
6
+ * A chart with axes cannot: text stretched by `preserveAspectRatio="none"`
7
+ * comes out distorted, so the drawing has to happen in real pixels and the
8
+ * width has to be measured.
9
+ *
10
+ * One observer per chart, not per mark — cheap enough at that granularity.
11
+ */
12
+ export declare function useElementSize(target: Ref<HTMLElement | undefined>): {
13
+ width: Ref<number, number>;
14
+ height: Ref<number, number>;
15
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The arithmetic every chart shares: find a domain, map it onto a range, and
3
+ * choose the numbers an axis is allowed to show.
4
+ *
5
+ * Deliberately not a charting engine — no band scales or stacking yet. Those
6
+ * arrive with the components that need them rather than being guessed at now.
7
+ */
8
+ /** A gap in a series. `null` reads as "no reading", not as zero. */
9
+ export type SparseValue = number | null | undefined;
10
+ /** Finite values only, so gaps and stray `NaN` cannot poison a domain. */
11
+ export declare function finiteValues(values: readonly SparseValue[]): number[];
12
+ /** Smallest and largest finite value, or `undefined` when there are none. */
13
+ export declare function extent(values: readonly SparseValue[]): [number, number] | undefined;
14
+ /**
15
+ * Map `domain` onto `range`.
16
+ *
17
+ * A zero-width domain — every value identical, or a single point — maps to the
18
+ * middle of the range instead of dividing by zero. A flat series should draw a
19
+ * flat line through the centre, not vanish or spike to an edge.
20
+ */
21
+ export declare function linearScale(domain: readonly [number, number], range: readonly [number, number]): (value: number) => number;
22
+ /**
23
+ * Axis values a person would actually write down.
24
+ *
25
+ * The difference between an axis reading `0 / 1,000 / 2,000` and one reading
26
+ * `0 / 863.4 / 1,726.8` is the single clearest tell of a hand-rolled chart, so
27
+ * the step is snapped to a 1/2/5 multiple of a power of ten and the domain is
28
+ * widened outwards to land on it. The returned bounds are therefore usually
29
+ * wider than the data — that is the point, and the caller should scale to the
30
+ * first and last tick rather than to its own min and max.
31
+ */
32
+ export declare function niceTicks(min: number, max: number, count?: number): {
33
+ ticks: number[];
34
+ min: number;
35
+ max: number;
36
+ };
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export type { AlertProps } from './components/Alert.vue';
5
5
  export type { AppProps } from './components/App.vue';
6
6
  export type { BadgeProps } from './components/Badge.vue';
7
7
  export type { BannerProps } from './components/Banner.vue';
8
+ export type { BarChartDatum, BarChartProps } from './components/BarChart.vue';
8
9
  export type { BreadcrumbItem, BreadcrumbProps } from './components/Breadcrumb.vue';
9
10
  export type { ButtonProps } from './components/Button.vue';
10
11
  export type { ButtonGroupProps } from './components/ButtonGroup.vue';
@@ -17,6 +18,7 @@ export type { DateRange, DateRangePickerProps } from './components/DateRangePick
17
18
  export type { DialogProps } from './components/Dialog.vue';
18
19
  export type { DropdownMenuProps } from './components/DropdownMenu.vue';
19
20
  export type { EmptyStateProps } from './components/EmptyState.vue';
21
+ export type { FileRejection, FileUploadProps } from './components/FileUpload.vue';
20
22
  export type { FormProps } from './components/Form.vue';
21
23
  export type { FormFieldProps } from './components/FormField.vue';
22
24
  export type { InputProps } from './components/Input.vue';
@@ -29,6 +31,7 @@ export type { RadioGroupItemOption, RadioGroupProps } from './components/RadioGr
29
31
  export type { SelectItemGroup, SelectItemOption, SelectItems, SelectProps } from './components/Select.vue';
30
32
  export type { SeparatorProps } from './components/Separator.vue';
31
33
  export type { SkeletonProps } from './components/Skeleton.vue';
34
+ export type { SparklineProps } from './components/Sparkline.vue';
32
35
  export type { StatProps } from './components/Stat.vue';
33
36
  export type { StepperItemOption, StepperProps } from './components/Stepper.vue';
34
37
  export type { SwitchProps } from './components/Switch.vue';
@@ -44,7 +47,9 @@ export * from './composables/data-table';
44
47
  export * from './composables/date';
45
48
  export * from './composables/decimal';
46
49
  export * from './composables/dropdown-menu';
50
+ export * from './composables/element-size';
47
51
  export * from './composables/form';
52
+ export * from './composables/scale';
48
53
  export * from './composables/toast';
49
54
  export { defaultConfig, iryxUiConfigKey, useIryxUiConfig } from './config';
50
55
  export type { IryxUiConfig } from './config';
package/dist/index.js CHANGED
@@ -9,73 +9,81 @@ import { badgeTheme as f } from "./packages/iryx-ui/src/theme/badge.js";
9
9
  import p from "./packages/iryx-ui/src/components/Badge.js";
10
10
  import { bannerTheme as m } from "./packages/iryx-ui/src/theme/banner.js";
11
11
  import h from "./packages/iryx-ui/src/components/Banner.js";
12
- import { breadcrumbTheme as g } from "./packages/iryx-ui/src/theme/breadcrumb.js";
13
- import _ from "./packages/iryx-ui/src/components/Breadcrumb.js";
14
- import { buttonGroupContextKey as v, useButtonGroup as y } from "./packages/iryx-ui/src/composables/button-group.js";
15
- import { buttonTheme as b } from "./packages/iryx-ui/src/theme/button.js";
16
- import x from "./packages/iryx-ui/src/components/Button.js";
17
- import { buttonGroupTheme as S } from "./packages/iryx-ui/src/theme/button-group.js";
18
- import C from "./packages/iryx-ui/src/components/ButtonGroup.js";
19
- import { cardTheme as w } from "./packages/iryx-ui/src/theme/card.js";
20
- import T from "./packages/iryx-ui/src/components/Card.js";
21
- import { checkboxTheme as E } from "./packages/iryx-ui/src/theme/checkbox.js";
22
- import D from "./packages/iryx-ui/src/components/Checkbox.js";
23
- import { formContextKey as O, formFieldContextKey as k, getByPath as A, isStandardSchema as j, issuePath as M, useForm as N, useFormField as P } from "./packages/iryx-ui/src/composables/form.js";
24
- import { fieldBase as F, inputTheme as I, textareaTheme as L } from "./packages/iryx-ui/src/theme/input.js";
25
- import { comboboxTheme as R } from "./packages/iryx-ui/src/theme/combobox.js";
26
- import z from "./packages/iryx-ui/src/components/Combobox.js";
27
- import { resolveConfirm as B, useConfirm as V, useConfirmState as H } from "./packages/iryx-ui/src/composables/confirm.js";
28
- import { dialogTheme as U } from "./packages/iryx-ui/src/theme/dialog.js";
29
- import W from "./packages/iryx-ui/src/components/Dialog.js";
30
- import G from "./packages/iryx-ui/src/components/ConfirmDialog.js";
31
- import { $2aaf608024c21ca1$export$99faa760c7908e4f as K } from "./node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js";
32
- import { formatIsoDate as q, isoToday as J, toCalendarDate as Y, toIsoDate as X } from "./packages/iryx-ui/src/composables/date.js";
33
- import { datePickerTheme as Z } from "./packages/iryx-ui/src/theme/date-picker.js";
34
- import Q from "./packages/iryx-ui/src/components/DatePicker.js";
35
- import $ from "./packages/iryx-ui/src/components/DateRangePicker.js";
36
- import { dropdownMenuTheme as ee } from "./packages/iryx-ui/src/theme/dropdown-menu.js";
37
- import { isSeparator as te, isSubmenu as ne } from "./packages/iryx-ui/src/composables/dropdown-menu.js";
38
- import re from "./packages/iryx-ui/src/components/DropdownMenu.js";
39
- import { emptyStateTheme as ie } from "./packages/iryx-ui/src/theme/empty-state.js";
40
- import ae from "./packages/iryx-ui/src/components/EmptyState.js";
41
- import oe from "./packages/iryx-ui/src/components/Form.js";
42
- import { labelTheme as se } from "./packages/iryx-ui/src/theme/label.js";
43
- import ce from "./packages/iryx-ui/src/components/Label.js";
44
- import le from "./packages/iryx-ui/src/components/FormField.js";
45
- import ue from "./packages/iryx-ui/src/components/Input.js";
46
- import { addDecimals as de, clampDecimal as fe, compareDecimals as pe, formatDecimal as me, formatForLocale as he, isDecimal as ge, localeSeparators as _e, parseDecimal as ve, parseFromLocale as ye, roundDecimal as be, toEditable as xe } from "./packages/iryx-ui/src/composables/decimal.js";
47
- import { numberInputTheme as Se } from "./packages/iryx-ui/src/theme/number-input.js";
48
- import Ce from "./packages/iryx-ui/src/components/NumberInput.js";
49
- import { paginationTheme as we } from "./packages/iryx-ui/src/theme/pagination.js";
50
- import Te from "./packages/iryx-ui/src/components/Pagination.js";
51
- import { passwordInputTheme as Ee } from "./packages/iryx-ui/src/theme/password-input.js";
52
- import De from "./packages/iryx-ui/src/components/PasswordInput.js";
53
- import { progressTheme as Oe } from "./packages/iryx-ui/src/theme/progress.js";
54
- import ke from "./packages/iryx-ui/src/components/Progress.js";
55
- import { radioGroupTheme as Ae } from "./packages/iryx-ui/src/theme/radio-group.js";
56
- import je from "./packages/iryx-ui/src/components/RadioGroup.js";
57
- import { selectTheme as Me } from "./packages/iryx-ui/src/theme/select.js";
58
- import Ne from "./packages/iryx-ui/src/components/Select.js";
59
- import { separatorTheme as Pe } from "./packages/iryx-ui/src/theme/separator.js";
60
- import Fe from "./packages/iryx-ui/src/components/Separator.js";
61
- import { skeletonTheme as Ie } from "./packages/iryx-ui/src/theme/skeleton.js";
62
- import Le from "./packages/iryx-ui/src/components/Skeleton.js";
63
- import { statTheme as Re } from "./packages/iryx-ui/src/theme/stat.js";
64
- import ze from "./packages/iryx-ui/src/components/Stat.js";
65
- import { stepperTheme as Be } from "./packages/iryx-ui/src/theme/stepper.js";
66
- import Ve from "./packages/iryx-ui/src/components/Stepper.js";
67
- import { switchTheme as He } from "./packages/iryx-ui/src/theme/switch.js";
68
- import Ue from "./packages/iryx-ui/src/components/Switch.js";
69
- import { getRowValue as We, useDataTable as Ge } from "./packages/iryx-ui/src/composables/data-table.js";
70
- import { tableTheme as Ke } from "./packages/iryx-ui/src/theme/table.js";
71
- import qe from "./packages/iryx-ui/src/components/Table.js";
72
- import { tabsTheme as Je } from "./packages/iryx-ui/src/theme/tabs.js";
73
- import Ye from "./packages/iryx-ui/src/components/Tabs.js";
74
- import Xe from "./packages/iryx-ui/src/components/Textarea.js";
75
- import { useToast as Ze, useToastState as Qe } from "./packages/iryx-ui/src/composables/toast.js";
76
- import { toastTheme as $e } from "./packages/iryx-ui/src/theme/toast.js";
77
- import et from "./packages/iryx-ui/src/components/Toaster.js";
78
- import { tooltipTheme as tt } from "./packages/iryx-ui/src/theme/tooltip.js";
79
- import nt from "./packages/iryx-ui/src/components/Tooltip.js";
80
- import { IryxUi as rt, createIryxUi as it } from "./packages/iryx-ui/src/plugin.js";
81
- export { a as Alert, d as App, p as Badge, h as Banner, _ as Breadcrumb, x as Button, C as ButtonGroup, K as CalendarDate, T as Card, D as Checkbox, z as Combobox, G as ConfirmDialog, Q as DatePicker, $ as DateRangePicker, W as Dialog, re as DropdownMenu, ae as EmptyState, oe as Form, le as FormField, ue as Input, rt as IryxUi, ce as Label, Ce as NumberInput, Te as Pagination, De as PasswordInput, ke as Progress, je as RadioGroup, Ne as Select, Fe as Separator, Le as Skeleton, ze as Stat, Ve as Stepper, Ue as Switch, qe as Table, Ye as Tabs, Xe as Textarea, et as Toaster, nt as Tooltip, de as addDecimals, i as alertTheme, c as applyTheme, f as badgeTheme, m as bannerTheme, g as breadcrumbTheme, v as buttonGroupContextKey, S as buttonGroupTheme, b as buttonTheme, w as cardTheme, E as checkboxTheme, fe as clampDecimal, l as clearTheme, R as comboboxTheme, pe as compareDecimals, e as componentNames, it as createIryxUi, Z as datePickerTheme, t as defaultConfig, U as dialogTheme, ee as dropdownMenuTheme, ie as emptyStateTheme, F as fieldBase, O as formContextKey, k as formFieldContextKey, me as formatDecimal, he as formatForLocale, q as formatIsoDate, A as getByPath, We as getRowValue, o as initAppearance, I as inputTheme, n as iryxUiConfigKey, ge as isDecimal, te as isSeparator, j as isStandardSchema, ne as isSubmenu, J as isoToday, M as issuePath, se as labelTheme, _e as localeSeparators, Se as numberInputTheme, we as paginationTheme, ve as parseDecimal, ye as parseFromLocale, Ee as passwordInputTheme, Oe as progressTheme, Ae as radioGroupTheme, B as resolveConfirm, be as roundDecimal, Me as selectTheme, Pe as separatorTheme, Ie as skeletonTheme, Re as statTheme, Be as stepperTheme, He as switchTheme, Ke as tableTheme, Je as tabsTheme, L as textareaTheme, u as themes, Y as toCalendarDate, xe as toEditable, X as toIsoDate, $e as toastTheme, tt as tooltipTheme, s as useAppearance, y as useButtonGroup, V as useConfirm, H as useConfirmState, Ge as useDataTable, N as useForm, P as useFormField, r as useIryxUiConfig, Ze as useToast, Qe as useToastState };
12
+ import { useElementSize as g } from "./packages/iryx-ui/src/composables/element-size.js";
13
+ import { extent as _, finiteValues as v, linearScale as y, niceTicks as b } from "./packages/iryx-ui/src/composables/scale.js";
14
+ import { barChartTheme as x } from "./packages/iryx-ui/src/theme/bar-chart.js";
15
+ import S from "./packages/iryx-ui/src/components/BarChart.js";
16
+ import { breadcrumbTheme as C } from "./packages/iryx-ui/src/theme/breadcrumb.js";
17
+ import w from "./packages/iryx-ui/src/components/Breadcrumb.js";
18
+ import { buttonGroupContextKey as T, useButtonGroup as E } from "./packages/iryx-ui/src/composables/button-group.js";
19
+ import { buttonTheme as D } from "./packages/iryx-ui/src/theme/button.js";
20
+ import O from "./packages/iryx-ui/src/components/Button.js";
21
+ import { buttonGroupTheme as k } from "./packages/iryx-ui/src/theme/button-group.js";
22
+ import A from "./packages/iryx-ui/src/components/ButtonGroup.js";
23
+ import { cardTheme as j } from "./packages/iryx-ui/src/theme/card.js";
24
+ import M from "./packages/iryx-ui/src/components/Card.js";
25
+ import { checkboxTheme as N } from "./packages/iryx-ui/src/theme/checkbox.js";
26
+ import P from "./packages/iryx-ui/src/components/Checkbox.js";
27
+ import { formContextKey as F, formFieldContextKey as I, getByPath as L, isStandardSchema as R, issuePath as z, useForm as B, useFormField as V } from "./packages/iryx-ui/src/composables/form.js";
28
+ import { fieldBase as H, inputTheme as U, textareaTheme as W } from "./packages/iryx-ui/src/theme/input.js";
29
+ import { comboboxTheme as G } from "./packages/iryx-ui/src/theme/combobox.js";
30
+ import K from "./packages/iryx-ui/src/components/Combobox.js";
31
+ import { resolveConfirm as q, useConfirm as J, useConfirmState as Y } from "./packages/iryx-ui/src/composables/confirm.js";
32
+ import { dialogTheme as X } from "./packages/iryx-ui/src/theme/dialog.js";
33
+ import Z from "./packages/iryx-ui/src/components/Dialog.js";
34
+ import Q from "./packages/iryx-ui/src/components/ConfirmDialog.js";
35
+ import { $2aaf608024c21ca1$export$99faa760c7908e4f as $ } from "./node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js";
36
+ import { formatIsoDate as ee, isoToday as te, toCalendarDate as ne, toIsoDate as re } from "./packages/iryx-ui/src/composables/date.js";
37
+ import { datePickerTheme as ie } from "./packages/iryx-ui/src/theme/date-picker.js";
38
+ import ae from "./packages/iryx-ui/src/components/DatePicker.js";
39
+ import oe from "./packages/iryx-ui/src/components/DateRangePicker.js";
40
+ import { dropdownMenuTheme as se } from "./packages/iryx-ui/src/theme/dropdown-menu.js";
41
+ import { isSeparator as ce, isSubmenu as le } from "./packages/iryx-ui/src/composables/dropdown-menu.js";
42
+ import ue from "./packages/iryx-ui/src/components/DropdownMenu.js";
43
+ import { emptyStateTheme as de } from "./packages/iryx-ui/src/theme/empty-state.js";
44
+ import fe from "./packages/iryx-ui/src/components/EmptyState.js";
45
+ import { fileUploadTheme as pe } from "./packages/iryx-ui/src/theme/file-upload.js";
46
+ import me from "./packages/iryx-ui/src/components/FileUpload.js";
47
+ import he from "./packages/iryx-ui/src/components/Form.js";
48
+ import { labelTheme as ge } from "./packages/iryx-ui/src/theme/label.js";
49
+ import _e from "./packages/iryx-ui/src/components/Label.js";
50
+ import ve from "./packages/iryx-ui/src/components/FormField.js";
51
+ import ye from "./packages/iryx-ui/src/components/Input.js";
52
+ import { addDecimals as be, clampDecimal as xe, compareDecimals as Se, formatDecimal as Ce, formatForLocale as we, isDecimal as Te, localeSeparators as Ee, parseDecimal as De, parseFromLocale as Oe, roundDecimal as ke, toEditable as Ae } from "./packages/iryx-ui/src/composables/decimal.js";
53
+ import { numberInputTheme as je } from "./packages/iryx-ui/src/theme/number-input.js";
54
+ import Me from "./packages/iryx-ui/src/components/NumberInput.js";
55
+ import { paginationTheme as Ne } from "./packages/iryx-ui/src/theme/pagination.js";
56
+ import Pe from "./packages/iryx-ui/src/components/Pagination.js";
57
+ import { passwordInputTheme as Fe } from "./packages/iryx-ui/src/theme/password-input.js";
58
+ import Ie from "./packages/iryx-ui/src/components/PasswordInput.js";
59
+ import { progressTheme as Le } from "./packages/iryx-ui/src/theme/progress.js";
60
+ import Re from "./packages/iryx-ui/src/components/Progress.js";
61
+ import { radioGroupTheme as ze } from "./packages/iryx-ui/src/theme/radio-group.js";
62
+ import Be from "./packages/iryx-ui/src/components/RadioGroup.js";
63
+ import { selectTheme as Ve } from "./packages/iryx-ui/src/theme/select.js";
64
+ import He from "./packages/iryx-ui/src/components/Select.js";
65
+ import { separatorTheme as Ue } from "./packages/iryx-ui/src/theme/separator.js";
66
+ import We from "./packages/iryx-ui/src/components/Separator.js";
67
+ import { skeletonTheme as Ge } from "./packages/iryx-ui/src/theme/skeleton.js";
68
+ import Ke from "./packages/iryx-ui/src/components/Skeleton.js";
69
+ import { sparklineTheme as qe } from "./packages/iryx-ui/src/theme/sparkline.js";
70
+ import Je from "./packages/iryx-ui/src/components/Sparkline.js";
71
+ import { statTheme as Ye } from "./packages/iryx-ui/src/theme/stat.js";
72
+ import Xe from "./packages/iryx-ui/src/components/Stat.js";
73
+ import { stepperTheme as Ze } from "./packages/iryx-ui/src/theme/stepper.js";
74
+ import Qe from "./packages/iryx-ui/src/components/Stepper.js";
75
+ import { switchTheme as $e } from "./packages/iryx-ui/src/theme/switch.js";
76
+ import et from "./packages/iryx-ui/src/components/Switch.js";
77
+ import { getRowValue as tt, useDataTable as nt } from "./packages/iryx-ui/src/composables/data-table.js";
78
+ import { tableTheme as rt } from "./packages/iryx-ui/src/theme/table.js";
79
+ import it from "./packages/iryx-ui/src/components/Table.js";
80
+ import { tabsTheme as at } from "./packages/iryx-ui/src/theme/tabs.js";
81
+ import ot from "./packages/iryx-ui/src/components/Tabs.js";
82
+ import st from "./packages/iryx-ui/src/components/Textarea.js";
83
+ import { useToast as ct, useToastState as lt } from "./packages/iryx-ui/src/composables/toast.js";
84
+ import { toastTheme as ut } from "./packages/iryx-ui/src/theme/toast.js";
85
+ import dt from "./packages/iryx-ui/src/components/Toaster.js";
86
+ import { tooltipTheme as ft } from "./packages/iryx-ui/src/theme/tooltip.js";
87
+ import pt from "./packages/iryx-ui/src/components/Tooltip.js";
88
+ import { IryxUi as mt, createIryxUi as ht } from "./packages/iryx-ui/src/plugin.js";
89
+ export { a as Alert, d as App, p as Badge, h as Banner, S as BarChart, w as Breadcrumb, O as Button, A as ButtonGroup, $ as CalendarDate, M as Card, P as Checkbox, K as Combobox, Q as ConfirmDialog, ae as DatePicker, oe as DateRangePicker, Z as Dialog, ue as DropdownMenu, fe as EmptyState, me as FileUpload, he as Form, ve as FormField, ye as Input, mt as IryxUi, _e as Label, Me as NumberInput, Pe as Pagination, Ie as PasswordInput, Re as Progress, Be as RadioGroup, He as Select, We as Separator, Ke as Skeleton, Je as Sparkline, Xe as Stat, Qe as Stepper, et as Switch, it as Table, ot as Tabs, st as Textarea, dt as Toaster, pt as Tooltip, be as addDecimals, i as alertTheme, c as applyTheme, f as badgeTheme, m as bannerTheme, x as barChartTheme, C as breadcrumbTheme, T as buttonGroupContextKey, k as buttonGroupTheme, D as buttonTheme, j as cardTheme, N as checkboxTheme, xe as clampDecimal, l as clearTheme, G as comboboxTheme, Se as compareDecimals, e as componentNames, ht as createIryxUi, ie as datePickerTheme, t as defaultConfig, X as dialogTheme, se as dropdownMenuTheme, de as emptyStateTheme, _ as extent, H as fieldBase, pe as fileUploadTheme, v as finiteValues, F as formContextKey, I as formFieldContextKey, Ce as formatDecimal, we as formatForLocale, ee as formatIsoDate, L as getByPath, tt as getRowValue, o as initAppearance, U as inputTheme, n as iryxUiConfigKey, Te as isDecimal, ce as isSeparator, R as isStandardSchema, le as isSubmenu, te as isoToday, z as issuePath, ge as labelTheme, y as linearScale, Ee as localeSeparators, b as niceTicks, je as numberInputTheme, Ne as paginationTheme, De as parseDecimal, Oe as parseFromLocale, Fe as passwordInputTheme, Le as progressTheme, ze as radioGroupTheme, q as resolveConfirm, ke as roundDecimal, Ve as selectTheme, Ue as separatorTheme, Ge as skeletonTheme, qe as sparklineTheme, Ye as statTheme, Ze as stepperTheme, $e as switchTheme, rt as tableTheme, at as tabsTheme, W as textareaTheme, u as themes, ne as toCalendarDate, Ae as toEditable, re as toIsoDate, ut as toastTheme, ft as tooltipTheme, s as useAppearance, E as useButtonGroup, J as useConfirm, Y as useConfirmState, nt as useDataTable, g as useElementSize, B as useForm, V as useFormField, r as useIryxUiConfig, ct as useToast, lt as useToastState };