nuance-ui 0.2.17 → 0.2.19

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 (57) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/alert.vue +1 -1
  3. package/dist/runtime/components/app-shell/app-shell-main.vue +1 -1
  4. package/dist/runtime/components/app-shell/app-shell.vue +1 -1
  5. package/dist/runtime/components/badge.d.vue.ts +4 -1
  6. package/dist/runtime/components/badge.vue +5 -2
  7. package/dist/runtime/components/badge.vue.d.ts +4 -1
  8. package/dist/runtime/components/button/button.module.css +1 -1
  9. package/dist/runtime/components/center.d.vue.ts +18 -0
  10. package/dist/runtime/components/center.vue +26 -0
  11. package/dist/runtime/components/center.vue.d.ts +18 -0
  12. package/dist/runtime/components/floating-indicator.d.vue.ts +20 -0
  13. package/dist/runtime/components/floating-indicator.vue +50 -0
  14. package/dist/runtime/components/floating-indicator.vue.d.ts +20 -0
  15. package/dist/runtime/components/group.d.vue.ts +28 -0
  16. package/dist/runtime/components/group.vue +39 -0
  17. package/dist/runtime/components/group.vue.d.ts +28 -0
  18. package/dist/runtime/components/index.d.ts +2 -0
  19. package/dist/runtime/components/input/ui/input-base.d.vue.ts +1 -0
  20. package/dist/runtime/components/input/ui/input-base.vue +3 -2
  21. package/dist/runtime/components/input/ui/input-base.vue.d.ts +1 -0
  22. package/dist/runtime/components/link/lib.d.ts +2 -2
  23. package/dist/runtime/components/nav-link/nav-link.vue +1 -1
  24. package/dist/runtime/components/paper.vue +1 -1
  25. package/dist/runtime/components/pin-input/lib.d.ts +2 -0
  26. package/dist/runtime/components/pin-input/lib.js +19 -0
  27. package/dist/runtime/components/pin-input/pin-input.d.vue.ts +55 -0
  28. package/dist/runtime/components/pin-input/pin-input.vue +171 -0
  29. package/dist/runtime/components/pin-input/pin-input.vue.d.ts +55 -0
  30. package/dist/runtime/components/pin-input/use-pin-input.d.ts +18 -0
  31. package/dist/runtime/components/pin-input/use-pin-input.js +94 -0
  32. package/dist/runtime/components/roving-focus/lib/context.d.ts +2 -2
  33. package/dist/runtime/components/segmented-control.d.vue.ts +46 -0
  34. package/dist/runtime/components/segmented-control.vue +130 -0
  35. package/dist/runtime/components/segmented-control.vue.d.ts +46 -0
  36. package/dist/runtime/components/stack.d.vue.ts +24 -0
  37. package/dist/runtime/components/stack.vue +33 -0
  38. package/dist/runtime/components/stack.vue.d.ts +24 -0
  39. package/dist/runtime/components/switch/switch.vue +1 -1
  40. package/dist/runtime/components/table/ui/table.vue +1 -1
  41. package/dist/runtime/components/theme-toggle.d.vue.ts +14 -0
  42. package/dist/runtime/components/theme-toggle.vue +27 -0
  43. package/dist/runtime/components/theme-toggle.vue.d.ts +14 -0
  44. package/dist/runtime/composables/index.d.ts +1 -0
  45. package/dist/runtime/composables/index.js +1 -0
  46. package/dist/runtime/composables/use-floating-indicator.d.ts +11 -0
  47. package/dist/runtime/composables/use-floating-indicator.js +30 -0
  48. package/dist/runtime/form/segmented-control-field.d.vue.ts +7 -0
  49. package/dist/runtime/form/segmented-control-field.vue +45 -0
  50. package/dist/runtime/form/segmented-control-field.vue.d.ts +7 -0
  51. package/dist/runtime/styles/colors.css +1 -1
  52. package/dist/runtime/styles/const.css +1 -1
  53. package/dist/runtime/styles/dark-theme.css +1 -1
  54. package/dist/runtime/types/theme.d.ts +3 -3
  55. package/dist/runtime/utils/color/get-color-var.js +1 -2
  56. package/dist/runtime/utils/color/parse-theme-color.js +1 -2
  57. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "0.2.17",
7
+ "version": "0.2.19",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -88,5 +88,5 @@ const style = useVarsResolver((theme) => {
88
88
  </template>
89
89
 
90
90
  <style module>
91
- .root{--alert-radius:var(--radius-default);--alert-bg:var(--color-primary-light);--alert-bd:1px solid transparent;--alert-color:var(--color-primary-light-color);background-color:var(--alert-bg);border:var(--alert-bd);border-radius:var(--alert-radius);color:var(--alert-color);gap:var(--spacing-md);overflow:hidden;padding:var(--spacing-md) var(--spacing-md);position:relative}.body,.root{display:flex}.body{flex:1;flex-direction:column;gap:var(--spacing-xs)}.title{align-items:center;display:flex;font-size:var(--font-size-sm);font-weight:700;justify-content:space-between}.label{display:block;overflow:hidden;text-overflow:ellipsis}.icon{align-items:center;display:flex;height:1.25rem;justify-content:flex-start;line-height:1;margin-top:1px;width:1.25rem}.message{font-size:var(--font-size-sm);overflow:hidden;text-overflow:ellipsis}:where([data-mantine-color-scheme=light]) .message{color:var(--color-black)}:where([data-mantine-color-scheme=dark]) .message{color:var(--color-white)}.message:where([data-variant=filled]){color:var(--alert-color)}.message:where([data-variant=white]){color:var(--color-black)}.closeButton{color:var(--alert-color);height:20px;width:20px}
91
+ .root{--alert-radius:var(--radius-default);--alert-bg:var(--color-primary-light);--alert-bd:1px solid transparent;--alert-color:var(--color-primary-light-color);background-color:var(--alert-bg);border:var(--alert-bd);border-radius:var(--alert-radius);color:var(--alert-color);gap:var(--spacing-sm);overflow:hidden;padding:var(--spacing-sm);position:relative}.body,.root{display:flex}.body{flex:1;flex-direction:column;gap:var(--spacing-xs)}.title{align-items:center;display:flex;font-size:var(--font-size-sm);font-weight:700;justify-content:space-between}.label{display:block;overflow:hidden;text-overflow:ellipsis}.icon{align-items:center;display:flex;height:1.25rem;justify-content:flex-start;line-height:1;margin-top:1px;width:1.25rem}.message{font-size:var(--font-size-sm);overflow:hidden;text-overflow:ellipsis}:where([data-mantine-color-scheme=light]) .message{color:var(--color-black)}:where([data-mantine-color-scheme=dark]) .message{color:var(--color-white)}.message:where([data-variant=filled]){color:var(--alert-color)}.message:where([data-variant=white]){color:var(--color-black)}.closeButton{color:var(--alert-color);height:20px;width:20px}
92
92
  </style>
@@ -13,5 +13,5 @@ const { mod } = defineProps({
13
13
  </template>
14
14
 
15
15
  <style module>
16
- .root{display:flex;flex-direction:column;min-height:100dvh;padding-bottom:calc(var(--app-shell-footer-offset, 0rem) + var(--app-shell-padding));padding-inline-end:calc(var(--app-shell-aside-offset, 0rem) + var(--app-shell-padding));padding-top:calc(var(--app-shell-header-offset, 0rem) + var(--app-shell-padding));padding-inline-start:calc(var(--app-shell-navbar-offset, 0rem) + var(--app-shell-padding));transition-duration:var(--app-shell-transition-duration);transition-property:padding;transition-timing-function:var(--app-shell-transition-timing-function)}
16
+ .root{min-height:100dvh;padding-bottom:calc(var(--app-shell-footer-offset, 0rem) + var(--app-shell-padding));padding-inline-end:calc(var(--app-shell-aside-offset, 0rem) + var(--app-shell-padding));padding-top:calc(var(--app-shell-header-offset, 0rem) + var(--app-shell-padding));padding-inline-start:calc(var(--app-shell-navbar-offset, 0rem) + var(--app-shell-padding));transition-duration:var(--app-shell-transition-duration);transition-property:padding;transition-timing-function:var(--app-shell-transition-timing-function)}
17
17
  </style>
@@ -51,5 +51,5 @@ const style = useVarsResolver(() => ({
51
51
  </template>
52
52
 
53
53
  <style module>
54
- .root{--app-shell-padding:var(--spacing-sm);--app-shell-element-padding:.25rem;--app-shell-transition-duration:200ms;--app-shell-transition-timing-function:ease;--app-shell-navbar-width:rem(56px);--app-shell-navbar-offset:var(--app-shell-navbar-width);--app-shell-navbar-transform:none;--app-shell-aside-width:rem(56px);--app-shell-aside-offset:var(--app-shell-aside-width);--app-shell-aside-transform:none;--app-shell-header-height:rem(56px);--app-shell-header-offset:var(--app-shell-header-height);--app-shell-header-transform:none;--app-shell-footer-height:rem(100px);--app-shell-footer-offset:var(--app-shell-footer-height);--app-shell-footer-transform:none;@mixin where-light{--app-shell-border-color:var(--color-gray-3)}@mixin where-dark{--app-shell-border-color:var(--color-slate-8)}}
54
+ .root{--app-shell-padding:var(--spacing-sm);--app-shell-element-padding:.25rem;--app-shell-transition-duration:200ms;--app-shell-transition-timing-function:ease;--app-shell-navbar-width:rem(56px);--app-shell-navbar-offset:var(--app-shell-navbar-width);--app-shell-navbar-transform:none;--app-shell-aside-width:rem(56px);--app-shell-aside-offset:var(--app-shell-aside-width);--app-shell-aside-transform:none;--app-shell-header-height:rem(56px);--app-shell-header-offset:var(--app-shell-header-height);--app-shell-header-transform:none;--app-shell-footer-height:rem(100px);--app-shell-footer-offset:var(--app-shell-footer-height);--app-shell-footer-transform:none;@mixin where-light{--app-shell-border-color:var(--color-gray-3)}@mixin where-dark{--app-shell-border-color:var(--color-dark-8)}}
55
55
  </style>
@@ -1,8 +1,9 @@
1
1
  import type { AnyString, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
2
+ import type { CSSProperties } from 'vue';
2
3
  import type { BoxProps } from './box.vue.js';
3
4
  export type BadgeVariant = 'filled' | 'light' | 'outline' | 'dot' | 'default' | 'gradient';
4
5
  export interface BadgeVars {
5
- root: '--badge-height' | '--badge-padding-x' | '--badge-fz' | '--badge-radius' | '--badge-bg' | '--badge-color' | '--badge-bd' | '--badge-dot-color';
6
+ root: '--badge-height' | '--badge-padding-x' | '--badge-fz' | '--badge-fw' | '--badge-radius' | '--badge-bg' | '--badge-color' | '--badge-bd' | '--badge-dot-color';
6
7
  }
7
8
  export interface BadgeProps extends BoxProps {
8
9
  /**
@@ -30,6 +31,8 @@ export interface BadgeProps extends BoxProps {
30
31
  icon?: string;
31
32
  /** Visual variant */
32
33
  variant?: BadgeVariant;
34
+ /** Font weight */
35
+ fw?: CSSProperties['font-weight'];
33
36
  }
34
37
  declare var __VLS_8: {}, __VLS_15: {}, __VLS_17: {};
35
38
  type __VLS_Slots = {} & {
@@ -9,7 +9,8 @@ const {
9
9
  color,
10
10
  fullWidth = false,
11
11
  circle,
12
- icon
12
+ icon,
13
+ fw
13
14
  } = defineProps({
14
15
  size: { type: [String, Object], required: false },
15
16
  circle: { type: Boolean, required: false },
@@ -19,6 +20,7 @@ const {
19
20
  fullWidth: { type: Boolean, required: false },
20
21
  icon: { type: String, required: false },
21
22
  variant: { type: String, required: false },
23
+ fw: { type: void 0, required: false },
22
24
  is: { type: null, required: false },
23
25
  mod: { type: [Object, Array, null], required: false }
24
26
  });
@@ -33,6 +35,7 @@ const style = useVarsResolver((theme) => {
33
35
  "--badge-height": getSize(size, "badge-height"),
34
36
  "--badge-padding-x": getSize(size, "badge-padding-x"),
35
37
  "--badge-fz": getSize(size, "badge-fz"),
38
+ "--badge-fw": fw,
36
39
  "--badge-radius": circle || radius === void 0 ? void 0 : getRadius(radius),
37
40
  "--badge-bg": color || variant ? background : void 0,
38
41
  "--badge-color": color || variant ? text : void 0,
@@ -77,5 +80,5 @@ const style = useVarsResolver((theme) => {
77
80
  </template>
78
81
 
79
82
  <style module>
80
- .root{--badge-height-xs:rem(16px);--badge-height-sm:rem(18px);--badge-height-md:rem(20px);--badge-height-lg:rem(26px);--badge-height-xl:rem(32px);--badge-fz-xs:rem(8px);--badge-fz-sm:rem(10px);--badge-fz-md:rem(12px);--badge-fz-lg:rem(14px);--badge-fz-xl:rem(16px);--badge-padding-x-xs:rem(6px);--badge-padding-x-sm:rem(8px);--badge-padding-x-md:rem(10px);--badge-padding-x-lg:rem(12px);--badge-padding-x-xl:rem(16px);--badge-height:var(--badge-height-md);--badge-fz:var(--badge-fz-md);--badge-padding-x:var(--badge-padding-x-md);--badge-radius:100%;--badge-lh:calc(var(--badge-height) - rem(2px));--badge-color:var(--color-white);--badge-bg:var(--color-primary-filled);--badge-border-width:1px;--badge-bd:var(--badge-border-width) solid transparent;align-items:center;background:var(--badge-bg);border:var(--badge-bd);border-radius:var(--badge-radius);color:var(--badge-color);cursor:default;display:inline-grid;font-size:var(--badge-fz);font-weight:700;height:var(--badge-height);justify-content:center;letter-spacing:.25px;line-height:var(--badge-lh);overflow:hidden;padding:0 var(--badge-padding-x);text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;width:-moz-fit-content;width:fit-content;-webkit-tap-highlight-color:transparent}.root:where([data-with-left-section],[data-variant=dot]){grid-template-columns:auto 1fr;padding-left:calc(var(--badge-padding-x) - var(--spacing-xs)/2)}.root:where([data-with-right-section]){grid-template-columns:1fr auto;padding-right:calc(var(--badge-padding-x) - var(--spacing-xs)/2)}.root:where([data-with-left-section][data-with-right-section],[data-variant=dot][data-with-right-section]){grid-template-columns:auto 1fr auto;padding:0 calc(var(--spacing-xs)/2)}.root:where([data-block]){display:flex;width:100%}.root:where([data-circle]){display:flex;padding-inline:2px;width:var(--badge-height)}.root:where([data-variant=dot]){@mixin where-light{--badge-color:var(--color-black)}@mixin where-dark{--badge-color:var(--color-white)}}.dot{--badge-dot-size:calc(var(--badge-height)/2);background-color:var(--badge-dot-color,var(--badge-color));border-radius:var(--badge-dot-size);display:block;height:var(--badge-dot-size);margin-inline-end:calc(var(--badge-dot-size)/2);width:var(--badge-dot-size)}.label{cursor:inherit;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.section{--badge-section-margin:calc(var(--spacing-xs)/2);align-items:center;display:inline-flex;justify-content:center;max-height:calc(var(--badge-height) - var(--badge-border-width)*2)}.section:where([data-position=left]){margin-inline-end:var(--badge-section-margin)}.section:where([data-position=right]){margin-inline-start:var(--badge-section-margin)}
83
+ .root{--badge-height-xs:rem(16px);--badge-height-sm:rem(18px);--badge-height-md:rem(20px);--badge-height-lg:rem(26px);--badge-height-xl:rem(32px);--badge-fz-xs:rem(8px);--badge-fz-sm:rem(10px);--badge-fz-md:rem(12px);--badge-fz-lg:rem(14px);--badge-fz-xl:rem(16px);--badge-fw:400;--badge-padding-x-xs:rem(6px);--badge-padding-x-sm:rem(8px);--badge-padding-x-md:rem(10px);--badge-padding-x-lg:rem(12px);--badge-padding-x-xl:rem(16px);--badge-height:var(--badge-height-md);--badge-fz:var(--badge-fz-md);--badge-padding-x:var(--badge-padding-x-md);--badge-radius:100%;--badge-lh:calc(var(--badge-height) - rem(2px));--badge-color:var(--color-white);--badge-bg:var(--color-primary-filled);--badge-border-width:1px;--badge-bd:var(--badge-border-width) solid transparent;align-items:center;background:var(--badge-bg);border:var(--badge-bd);border-radius:var(--badge-radius);color:var(--badge-color);cursor:default;display:inline-grid;font-size:var(--badge-fz);font-weight:var(--badge-fw);height:var(--badge-height);justify-content:center;letter-spacing:.25px;line-height:var(--badge-lh);overflow:hidden;padding:0 var(--badge-padding-x);text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;width:-moz-fit-content;width:fit-content;-webkit-tap-highlight-color:transparent}.root:where([data-with-left-section],[data-variant=dot]){grid-template-columns:auto 1fr;padding-left:calc(var(--badge-padding-x) - var(--spacing-xs)/2)}.root:where([data-with-right-section]){grid-template-columns:1fr auto;padding-right:calc(var(--badge-padding-x) - var(--spacing-xs)/2)}.root:where([data-with-left-section][data-with-right-section],[data-variant=dot][data-with-right-section]){grid-template-columns:auto 1fr auto;padding:0 calc(var(--spacing-xs)/2)}.root:where([data-block]){display:flex;width:100%}.root:where([data-circle]){display:flex;padding-inline:2px;width:var(--badge-height)}.root:where([data-variant=dot]){@mixin where-light{--badge-color:var(--color-black)}@mixin where-dark{--badge-color:var(--color-white)}}.dot{--badge-dot-size:calc(var(--badge-height)/2);background-color:var(--badge-dot-color,var(--badge-color));border-radius:var(--badge-dot-size);display:block;height:var(--badge-dot-size);margin-inline-end:calc(var(--badge-dot-size)/2);width:var(--badge-dot-size)}.label{cursor:inherit;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.section{--badge-section-margin:calc(var(--spacing-xs)/2);align-items:center;display:inline-flex;justify-content:center;max-height:calc(var(--badge-height) - var(--badge-border-width)*2)}.section:where([data-position=left]){margin-inline-end:var(--badge-section-margin)}.section:where([data-position=right]){margin-inline-start:var(--badge-section-margin)}
81
84
  </style>
@@ -1,8 +1,9 @@
1
1
  import type { AnyString, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
2
+ import type { CSSProperties } from 'vue';
2
3
  import type { BoxProps } from './box.vue.js';
3
4
  export type BadgeVariant = 'filled' | 'light' | 'outline' | 'dot' | 'default' | 'gradient';
4
5
  export interface BadgeVars {
5
- root: '--badge-height' | '--badge-padding-x' | '--badge-fz' | '--badge-radius' | '--badge-bg' | '--badge-color' | '--badge-bd' | '--badge-dot-color';
6
+ root: '--badge-height' | '--badge-padding-x' | '--badge-fz' | '--badge-fw' | '--badge-radius' | '--badge-bg' | '--badge-color' | '--badge-bd' | '--badge-dot-color';
6
7
  }
7
8
  export interface BadgeProps extends BoxProps {
8
9
  /**
@@ -30,6 +31,8 @@ export interface BadgeProps extends BoxProps {
30
31
  icon?: string;
31
32
  /** Visual variant */
32
33
  variant?: BadgeVariant;
34
+ /** Font weight */
35
+ fw?: CSSProperties['font-weight'];
33
36
  }
34
37
  declare var __VLS_8: {}, __VLS_15: {}, __VLS_17: {};
35
38
  type __VLS_Slots = {} & {
@@ -1 +1 @@
1
- .root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);--button-spacing:0;--button-justify:center;--button-section-size:calc(var(--button-height) - 0.25rem);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:0}.root:where([data-with-right-section]){padding-inline-end:0}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{gap:var(--button-spacing);justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease;width:100%}.inner,.label{align-items:center;display:flex;height:100%}.label{flex:1;justify-content:var(--button-justify);opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;height:100%;justify-content:center;pointer-events:var(--section-pointer-events);width:var(--button-section-size)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--group-border-width:1px;display:flex}.group>:where(*):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal]>:where(*):not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--group-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--group-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--group-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical]>:where(*):not(:only-child):first-child{border-bottom-width:calc(var(--group-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical]>:where(*):not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--group-border-width)/2)}.group[data-orientation=vertical]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--group-border-width)/2);border-radius:0;border-top-width:calc(var(--group-border-width)/2)}
1
+ .root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);--button-spacing:0;--button-justify:center;--button-section-size:calc(var(--button-height) - 0.25rem);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:0}.root:where([data-with-right-section]){padding-inline-end:0}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled-text);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{gap:var(--button-spacing);justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease;width:100%}.inner,.label{align-items:center;display:flex;height:100%}.label{flex:1;justify-content:var(--button-justify);opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;height:100%;justify-content:center;pointer-events:var(--section-pointer-events);width:var(--button-section-size)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--group-border-width:1px;display:flex}.group>:where(*):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal]>:where(*):not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--group-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--group-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--group-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical]>:where(*):not(:only-child):first-child{border-bottom-width:calc(var(--group-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical]>:where(*):not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--group-border-width)/2)}.group[data-orientation=vertical]>:where(*):not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--group-border-width)/2);border-radius:0;border-top-width:calc(var(--group-border-width)/2)}
@@ -0,0 +1,18 @@
1
+ import type { BoxProps } from './box.vue.js';
2
+ export interface CenterProps extends BoxProps {
3
+ /** If set, `inline-flex` is used instead of `flex` */
4
+ inline?: boolean;
5
+ }
6
+ declare var __VLS_8: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_8) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<CenterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CenterProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,26 @@
1
+ <script setup>
2
+ import Box from "./box.vue";
3
+ const {
4
+ inline,
5
+ mod,
6
+ ...props
7
+ } = defineProps({
8
+ inline: { type: Boolean, required: false },
9
+ is: { type: null, required: false },
10
+ mod: { type: [Object, Array, null], required: false }
11
+ });
12
+ </script>
13
+
14
+ <template>
15
+ <Box
16
+ v-bind='props'
17
+ :class='$style.root'
18
+ :mod='[{ inline }, mod]'
19
+ >
20
+ <slot />
21
+ </Box>
22
+ </template>
23
+
24
+ <style module>
25
+ .root{align-items:center;display:flex;justify-content:center}.root:where([data-inline]){display:inline-flex}
26
+ </style>
@@ -0,0 +1,18 @@
1
+ import type { BoxProps } from './box.vue.js';
2
+ export interface CenterProps extends BoxProps {
3
+ /** If set, `inline-flex` is used instead of `flex` */
4
+ inline?: boolean;
5
+ }
6
+ declare var __VLS_8: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_8) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<CenterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CenterProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,20 @@
1
+ import type { BoxProps } from './box.vue.js';
2
+ export interface FloatingIndicatorProps extends BoxProps {
3
+ /**
4
+ * Target element over which the indicator is displayed.
5
+ * The indicator will be positioned to match the target's size and position.
6
+ */
7
+ target: HTMLElement | null | undefined;
8
+ /**
9
+ * Parent container element that must have `position: relative`.
10
+ * The indicator's position is calculated relative to this element.
11
+ */
12
+ parent: HTMLElement | null | undefined;
13
+ /** Component orientation */
14
+ orientation?: 'horizontal' | 'vertical';
15
+ /** Transition duration in ms or CSS time value @default `150` */
16
+ transitionDuration?: number | string;
17
+ }
18
+ declare const __VLS_export: import("vue").DefineComponent<FloatingIndicatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FloatingIndicatorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,50 @@
1
+ <script setup>
2
+ import { useFloatingIndicator, useVarsResolver } from "@nui/composables";
3
+ import { shallowRef, watch } from "vue";
4
+ import Box from "./box.vue";
5
+ const {
6
+ is = "span",
7
+ mod,
8
+ target,
9
+ parent,
10
+ orientation = "horizontal",
11
+ transitionDuration: duration
12
+ } = defineProps({
13
+ target: { type: null, required: true },
14
+ parent: { type: null, required: true },
15
+ orientation: { type: String, required: false },
16
+ transitionDuration: { type: [Number, String], required: false },
17
+ is: { type: null, required: false },
18
+ mod: { type: [Object, Array, null], required: false }
19
+ });
20
+ const _target = shallowRef(target ?? null);
21
+ const _parent = shallowRef(parent ?? null);
22
+ watch(() => target, (v) => _target.value = v ?? null);
23
+ watch(() => parent, (v) => _parent.value = v ?? null);
24
+ const { size, position } = useFloatingIndicator({
25
+ target: _target,
26
+ parent: _parent,
27
+ orientation
28
+ });
29
+ const style = useVarsResolver(() => ({
30
+ root: {
31
+ "--fi-duration": duration === void 0 ? void 0 : duration === "number" ? `${duration}ms` : duration,
32
+ "--fi-size": `${size.value ?? 0}px`,
33
+ "--fi-position": `${position.value ?? 0}px`
34
+ }
35
+ }));
36
+ </script>
37
+
38
+ <template>
39
+ <Box
40
+ :is
41
+ v-if='target && parent && size !== null'
42
+ :style='style.root'
43
+ :class='$style.root'
44
+ :mod='[{ orientation }, mod]'
45
+ />
46
+ </template>
47
+
48
+ <style module>
49
+ .root{position:absolute;transition-duration:var(--fi-duration,.15s);transition-property:width,height,transform;transition-timing-function:ease;z-index:0}.root:where([data-orientation=horizontal]){bottom:0;left:0;top:0;transform:translateX(var(--fi-position));width:var(--fi-size)}.root:where([data-orientation=vertical]){height:var(--fi-size);left:0;right:0;top:0;transform:translateY(var(--fi-position))}
50
+ </style>
@@ -0,0 +1,20 @@
1
+ import type { BoxProps } from './box.vue.js';
2
+ export interface FloatingIndicatorProps extends BoxProps {
3
+ /**
4
+ * Target element over which the indicator is displayed.
5
+ * The indicator will be positioned to match the target's size and position.
6
+ */
7
+ target: HTMLElement | null | undefined;
8
+ /**
9
+ * Parent container element that must have `position: relative`.
10
+ * The indicator's position is calculated relative to this element.
11
+ */
12
+ parent: HTMLElement | null | undefined;
13
+ /** Component orientation */
14
+ orientation?: 'horizontal' | 'vertical';
15
+ /** Transition duration in ms or CSS time value @default `150` */
16
+ transitionDuration?: number | string;
17
+ }
18
+ declare const __VLS_export: import("vue").DefineComponent<FloatingIndicatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FloatingIndicatorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import type { CSSProperties } from 'vue';
2
+ import type { NuanceSpacing } from '../types/index.js';
3
+ import type { BoxProps } from './box.vue.js';
4
+ export interface GroupProps extends BoxProps {
5
+ /** Controls `justify-content` CSS property @default 'flex-start' */
6
+ justify?: CSSProperties['justifyContent'];
7
+ /** Controls `align-items` CSS property @default 'center' */
8
+ align?: CSSProperties['alignItems'];
9
+ /** Controls `flex-wrap` CSS property @default 'wrap' */
10
+ wrap?: CSSProperties['flexWrap'];
11
+ /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem @default 'md' */
12
+ gap?: NuanceSpacing;
13
+ /** Determines whether each child element should have `flex-grow: 1` style @default false */
14
+ grow?: boolean;
15
+ }
16
+ declare var __VLS_8: {};
17
+ type __VLS_Slots = {} & {
18
+ default?: (props: typeof __VLS_8) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<GroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,39 @@
1
+ <script setup>
2
+ import { getSpacing, useVarsResolver } from "#imports";
3
+ import Box from "./box.vue";
4
+ const {
5
+ grow,
6
+ justify,
7
+ align,
8
+ wrap,
9
+ gap,
10
+ mod,
11
+ ...props
12
+ } = defineProps({
13
+ justify: { type: void 0, required: false },
14
+ align: { type: void 0, required: false },
15
+ wrap: { type: void 0, required: false },
16
+ gap: { type: [String, Number], required: false },
17
+ grow: { type: Boolean, required: false },
18
+ is: { type: null, required: false },
19
+ mod: { type: [Object, Array, null], required: false }
20
+ });
21
+ const style = useVarsResolver(() => ({
22
+ root: {
23
+ "--group-gap": getSpacing(gap),
24
+ "--group-align": align ?? void 0,
25
+ "--group-justify": justify ?? void 0,
26
+ "--group-wrap": wrap ?? void 0
27
+ }
28
+ }));
29
+ </script>
30
+
31
+ <template>
32
+ <Box v-bind='props' :style='style.root' :class='$style.root' :mod='[{ grow }, mod]'>
33
+ <slot />
34
+ </Box>
35
+ </template>
36
+
37
+ <style module>
38
+ .root{align-items:var(--group-align,center);display:flex;flex-direction:row;flex-wrap:var(--group-wrap,wrap);gap:var(--group-gap,var(--spacing-md));justify-content:var(--group-justify,flex-start)}.root:where([data-grow])>*{flex-grow:1}
39
+ </style>
@@ -0,0 +1,28 @@
1
+ import type { CSSProperties } from 'vue';
2
+ import type { NuanceSpacing } from '../types/index.js';
3
+ import type { BoxProps } from './box.vue.js';
4
+ export interface GroupProps extends BoxProps {
5
+ /** Controls `justify-content` CSS property @default 'flex-start' */
6
+ justify?: CSSProperties['justifyContent'];
7
+ /** Controls `align-items` CSS property @default 'center' */
8
+ align?: CSSProperties['alignItems'];
9
+ /** Controls `flex-wrap` CSS property @default 'wrap' */
10
+ wrap?: CSSProperties['flexWrap'];
11
+ /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem @default 'md' */
12
+ gap?: NuanceSpacing;
13
+ /** Determines whether each child element should have `flex-grow: 1` style @default false */
14
+ grow?: boolean;
15
+ }
16
+ declare var __VLS_8: {};
17
+ type __VLS_Slots = {} & {
18
+ default?: (props: typeof __VLS_8) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<GroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -16,6 +16,7 @@ export type * from './date-time-picker.vue';
16
16
  export * from './dialog/index.js';
17
17
  export * from './drawer/index.js';
18
18
  export * from './files/index.js';
19
+ export type * from './floating-indicator.vue';
19
20
  export * from './input/index.js';
20
21
  export * from './link/index.js';
21
22
  export * from './loader/index.js';
@@ -25,6 +26,7 @@ export type * from './paper.vue';
25
26
  export * from './popover/index.js';
26
27
  export * from './progress/index.js';
27
28
  export * from './roving-focus/index.js';
29
+ export type * from './segmented-control.vue';
28
30
  export type * from './select.vue';
29
31
  export * from './switch/index.js';
30
32
  export * from './table/index.js';
@@ -3,6 +3,7 @@ import type { WrapperContext } from '../lib/input-wrapper.context.js';
3
3
  export interface BaseInputProps extends Omit<WrapperContext, 'id'> {
4
4
  /** Styles API */
5
5
  classes?: Classes<'root' | 'section'>;
6
+ error?: boolean;
6
7
  }
7
8
  type __VLS_Slots = {
8
9
  leftSection: [];
@@ -5,6 +5,7 @@ import Box from "../../box.vue";
5
5
  import { useInputWrapperState } from "../lib/input-wrapper.context";
6
6
  const { classes, ...props } = defineProps({
7
7
  classes: { type: Object, required: false },
8
+ error: { type: Boolean, required: false },
8
9
  required: { type: Boolean, required: false },
9
10
  radius: { type: [String, Number, Object], required: false },
10
11
  size: { type: [String, Object], required: false },
@@ -35,7 +36,7 @@ const style = computed(() => ({
35
36
  "with-left-section": !!$slots.leftSection,
36
37
  "with-right-section": !!$slots.rightSection,
37
38
  "variant": api.variant,
38
- "error": !!api?.error
39
+ "error": !!api?.error || props.error
39
40
  }]'
40
41
  >
41
42
  <span
@@ -59,5 +60,5 @@ const style = computed(() => ({
59
60
  </template>
60
61
 
61
62
  <style module>
62
- .root{--input-height-xs:rem(30px);--input-height-sm:rem(36px);--input-height-md:rem(42px);--input-height-lg:rem(50px);--input-height-xl:rem(60px);--input-padding-y-xs:rem(5px);--input-padding-y-sm:rem(6px);--input-padding-y-md:rem(8px);--input-padding-y-lg:rem(10px);--input-padding-y-xl:rem(13px);--input-height:var(--input-height-sm);--input-radius:var(--radius-default);--input-cursor:text;--input-text-align:left;--input-line-height:calc(var(--input-height) - rem(2px));--input-padding:calc(var(--input-height)/3);--input-padding-inline-start:var(--input-padding);--input-padding-inline-end:var(--input-padding);--input-placeholder-color:var(--color-placeholder);--input-color:var(--color-text);--input-left-section-width:calc(var(--input-height) - rem(2px));--input-right-section-width:calc(var(--input-height) - rem(2px));--input-left-section-pointer-events:none;--input-right-section-pointer-events:none;--input-left-section-size:var(--input-left-section-width);--input-right-section-size:var(--input-right-section-width);--input-fz:var(--font-size-sm);--input-size:var(--input-height);--input-resize:none;--section-y:1px;--left-section-start:1px;--left-section-border-radius:var(--input-radius) 0 0 var(--input-radius);--right-section-end:1px;--right-section-border-radius:0 var(--input-radius) var(--input-radius) 0;position:relative}.root[data-variant=unstyled]{--input-padding:0;--input-padding-y:0;--input-padding-inline-start:0;--input-padding-inline-end:0}.root[data-pointer]{--input-cursor:pointer}.root[data-multiline]{--input-padding-y-xs:4.5px;--input-padding-y-sm:5.5px;--input-padding-y-md:7px;--input-padding-y-lg:9.5px;--input-padding-y-xl:13px;--input-size:auto;--input-line-height:var(--line-height);--input-padding-y:var(--input-padding-y-sm)}.root[data-with-left-section]{--input-padding-inline-start:var(--input-left-section-size)}.root[data-with-right-section]{--input-padding-inline-end:var(--input-right-section-size)}.root[data-error]{--input-color:var(--color-error);--input-placeholder-color:var(--color-error);--input-section-color:var(--color-error);--input-bd:var(--color-error)}.root{@mixin where-light{--input-disabled-bg:var(--color-gray-1);--input-disabled-color:var(--color-gray-6);&[data-variant=default]:not(&[data-error]){--input-bd:var(--color-gray-4);--input-bg:var(--color-white);--input-bd-focus:var(--color-primary-filled)}&[data-variant=filled]:not(&[data-error]){--input-bd:transparent;--input-bg:var(--color-gray-1);--input-bd-focus:var(--color-primary-filled)}&[data-variant=unstyled]:not(&[data-error]){--input-bd:transparent;--input-bg:transparent;--input-bd-focus:transparent}}}.root{@mixin where-dark{--input-disabled-bg:var(--color-dark-6);--input-disabled-color:var(--color-dark-2);&[data-variant=default]:not(&[data-error]){--input-bd:var(--color-dark-4);--input-bg:var(--color-dark-6);--input-bd-focus:var(--color-primary-filled)}&[data-variant=filled]:not(&[data-error]){--input-bd:transparent;--input-bg:var(--color-dark-5);--input-bd-focus:var(--color-primary-filled)}&[data-variant=unstyled]:not(&[data-error]){--input-bd:transparent;--input-bg:transparent;--input-bd-focus:transparent}}}.root{@mixin where-rtl{--input-text-align:right;--left-section-border-radius:0 var(--input-radius) var(--input-radius) 0;--right-section-border-radius:var(--input-radius) 0 0 var(--input-radius)}}.input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--input-bg);border:rem(1px) solid var(--input-bd);border-radius:var(--input-radius);color:var(--input-color);cursor:var(--input-cursor);display:block;font-family:var(--font-family),serif;font-size:var(--input-fz);height:var(--input-size);line-height:var(--input-line-height);min-height:var(--input-height);overflow:var(--input-overflow);padding-bottom:var(--input-padding-y,0);padding-inline-end:var(--input-padding-inline-end);padding-top:var(--input-padding-y,0);padding-inline-start:var(--input-padding-inline-start);resize:var(--input-resize,none);text-align:var(--input-text-align);transition:border-color .1s ease;width:100%;-webkit-tap-highlight-color:transparent}.input[data-no-overflow]{--input-overflow:hidden}.input:focus,.input:focus-within{--input-bd:var(--input-bd-focus);outline:none}[data-error] .input:focus,[data-error] .input:focus-within{--input-bd:var(--color-error)}.input::-moz-placeholder{color:var(--input-placeholder-color);opacity:1}.input::placeholder{color:var(--input-placeholder-color);opacity:1}.input::-webkit-inner-spin-button,.input::-webkit-outer-spin-button,.input::-webkit-search-cancel-button,.input::-webkit-search-decoration,.input::-webkit-search-results-button,.input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.input:disabled,.input[data-disabled]{background-color:var(--input-disabled-bg);color:var(--input-disabled-color);cursor:not-allowed;opacity:.6}.input:has(input:disabled){background-color:var(--input-disabled-bg);color:var(--input-disabled-color);cursor:not-allowed;opacity:.6}.section{align-items:center;border-radius:var(--section-border-radius);bottom:var(--section-y);color:var(--input-section-color,var(--color-dimmed));display:flex;inset-inline-end:var(--section-end);inset-inline-start:var(--section-start);justify-content:center;pointer-events:var(--section-pointer-events);position:absolute;top:var(--section-y);width:var(--section-size);z-index:1}.section[data-position=right]{--section-pointer-events:var(--input-right-section-pointer-events);--section-end:var(--right-section-end);--section-size:var(--input-right-section-size);--section-border-radius:var(--right-section-border-radius)}.section[data-position=left]{--section-pointer-events:var(--input-left-section-pointer-events);--section-start:var(--left-section-start);--section-size:var(--input-left-section-size);--section-border-radius:var(--left-section-border-radius)}
63
+ .root{--input-height-xs:rem(30px);--input-height-sm:rem(36px);--input-height-md:rem(42px);--input-height-lg:rem(50px);--input-height-xl:rem(60px);--input-padding-y-xs:rem(5px);--input-padding-y-sm:rem(6px);--input-padding-y-md:rem(8px);--input-padding-y-lg:rem(10px);--input-padding-y-xl:rem(13px);--input-height:var(--input-height-sm);--input-radius:var(--radius-default);--input-cursor:text;--input-text-align:left;--input-line-height:calc(var(--input-height) - rem(2px));--input-padding:calc(var(--input-height)/3);--input-padding-inline-start:var(--input-padding);--input-padding-inline-end:var(--input-padding);--input-placeholder-color:var(--color-placeholder);--input-color:var(--color-text);--input-left-section-width:calc(var(--input-height) - rem(2px));--input-right-section-width:calc(var(--input-height) - rem(2px));--input-left-section-pointer-events:none;--input-right-section-pointer-events:none;--input-left-section-size:var(--input-left-section-width);--input-right-section-size:var(--input-right-section-width);--input-fz:var(--font-size-sm);--input-size:var(--input-height);--input-resize:none;--section-y:1px;--left-section-start:1px;--left-section-border-radius:var(--input-radius) 0 0 var(--input-radius);--right-section-end:1px;--right-section-border-radius:0 var(--input-radius) var(--input-radius) 0;position:relative}.root[data-variant=unstyled]{--input-padding:0;--input-padding-y:0;--input-padding-inline-start:0;--input-padding-inline-end:0}.root[data-pointer]{--input-cursor:pointer}.root[data-multiline]{--input-padding-y-xs:4.5px;--input-padding-y-sm:5.5px;--input-padding-y-md:7px;--input-padding-y-lg:9.5px;--input-padding-y-xl:13px;--input-size:auto;--input-line-height:var(--line-height);--input-padding-y:var(--input-padding-y-sm)}.root[data-with-left-section]{--input-padding-inline-start:var(--input-left-section-size)}.root[data-with-right-section]{--input-padding-inline-end:var(--input-right-section-size)}.root{@mixin where-light{--input-disabled-bg:var(--color-gray-1);--input-disabled-color:var(--color-gray-6);&[data-variant=default]:not(&[data-error]){--input-bd:var(--color-gray-4);--input-bg:var(--color-white);--input-bd-focus:var(--color-primary-filled)}&[data-variant=filled]:not(&[data-error]){--input-bd:transparent;--input-bg:var(--color-gray-1);--input-bd-focus:var(--color-primary-filled)}&[data-variant=unstyled]:not(&[data-error]){--input-bd:transparent;--input-bg:transparent;--input-bd-focus:transparent}}}.root{@mixin where-dark{--input-disabled-bg:var(--color-dark-6);--input-disabled-color:var(--color-dark-2);&[data-variant=default]:not(&[data-error]){--input-bd:var(--color-dark-4);--input-bg:var(--color-dark-6);--input-bd-focus:var(--color-primary-filled)}&[data-variant=filled]:not(&[data-error]){--input-bd:transparent;--input-bg:var(--color-dark-5);--input-bd-focus:var(--color-primary-filled)}&[data-variant=unstyled]:not(&[data-error]){--input-bd:transparent;--input-bg:transparent;--input-bd-focus:transparent}}}.root[data-error]{--input-color:var(--color-error);--input-placeholder-color:var(--color-error);--input-section-color:var(--color-error);--input-bd:var(--color-error)}.root{@mixin where-rtl{--input-text-align:right;--left-section-border-radius:0 var(--input-radius) var(--input-radius) 0;--right-section-border-radius:var(--input-radius) 0 0 var(--input-radius)}}.input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--input-bg);border:rem(1px) solid var(--input-bd);border-radius:var(--input-radius);color:var(--input-color);cursor:var(--input-cursor);display:block;font-family:var(--font-family),serif;font-size:var(--input-fz);height:var(--input-size);line-height:var(--input-line-height);min-height:var(--input-height);overflow:var(--input-overflow);padding-bottom:var(--input-padding-y,0);padding-inline-end:var(--input-padding-inline-end);padding-top:var(--input-padding-y,0);padding-inline-start:var(--input-padding-inline-start);resize:var(--input-resize,none);text-align:var(--input-text-align);transition:border-color .1s ease;width:100%;-webkit-tap-highlight-color:transparent}.input[data-no-overflow]{--input-overflow:hidden}.input:focus,.input:focus-within{--input-bd:var(--input-bd-focus);outline:none}[data-error] .input:focus,[data-error] .input:focus-within{--input-bd:var(--color-error)}.input::-moz-placeholder{color:var(--input-placeholder-color);opacity:1}.input::placeholder{color:var(--input-placeholder-color);opacity:1}.input::-webkit-inner-spin-button,.input::-webkit-outer-spin-button,.input::-webkit-search-cancel-button,.input::-webkit-search-decoration,.input::-webkit-search-results-button,.input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.input:disabled,.input:has(input:disabled),.input[data-disabled]{background-color:var(--input-disabled-bg);color:var(--input-disabled-color);cursor:not-allowed;opacity:.6}.input:-moz-read-only{cursor:default}.input:read-only{cursor:default}.section{align-items:center;border-radius:var(--section-border-radius);bottom:var(--section-y);color:var(--input-section-color,var(--color-dimmed));display:flex;inset-inline-end:var(--section-end);inset-inline-start:var(--section-start);justify-content:center;pointer-events:var(--section-pointer-events);position:absolute;top:var(--section-y);width:var(--section-size);z-index:1}.section[data-position=right]{--section-pointer-events:var(--input-right-section-pointer-events);--section-end:var(--right-section-end);--section-size:var(--input-right-section-size);--section-border-radius:var(--right-section-border-radius)}.section[data-position=left]{--section-pointer-events:var(--input-left-section-pointer-events);--section-start:var(--left-section-start);--section-size:var(--input-left-section-size);--section-border-radius:var(--left-section-border-radius)}
63
64
  </style>
@@ -3,6 +3,7 @@ import type { WrapperContext } from '../lib/input-wrapper.context.js';
3
3
  export interface BaseInputProps extends Omit<WrapperContext, 'id'> {
4
4
  /** Styles API */
5
5
  classes?: Classes<'root' | 'section'>;
6
+ error?: boolean;
6
7
  }
7
8
  type __VLS_Slots = {
8
9
  leftSection: [];
@@ -1,5 +1,5 @@
1
1
  import type { NuxtLinkProps } from '#app';
2
2
  export declare function pickLinkProps<T extends NuxtLinkProps>(props: T): {
3
- link: Pick<T, "to" | "target" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "replace" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
4
- rest: Omit<T, "to" | "target" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "replace" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
3
+ link: Pick<T, "target" | "to" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "replace" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
4
+ rest: Omit<T, "target" | "to" | "external" | "rel" | "noRel" | "prefetch" | "noPrefetch" | "replace" | "prefetchOn" | "trailingSlash" | "activeClass" | "ariaCurrentValue" | "exactActiveClass" | "prefetchedClass" | "viewTransition">;
5
5
  };
@@ -69,7 +69,7 @@ const style = useVarsResolver((theme) => {
69
69
  :href
70
70
  :style='style.root'
71
71
  :class='$style.root'
72
- :mod='[{ active: active ?? isActive, disabled }, mod]'
72
+ :mod='[{ active: active || isActive, disabled }, mod]'
73
73
  :aria-current="isActive ? 'page' : void 0"
74
74
  :rel='"rel" in linkProps ? linkProps?.rel : void 0'
75
75
  :target='"target" in linkProps ? linkProps?.target : void 0'
@@ -22,5 +22,5 @@ const style = computed(() => ({
22
22
  </template>
23
23
 
24
24
  <style module>
25
- .root{--paper-radius:var(--radius-default);--paper-shadow:none;background-color:var(--color-body);border-radius:var(--paper-radius);box-shadow:var(--paper-shadow);display:block;outline:0;text-decoration:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.root:where([data-with-border]){border:rem(1px) solid var(--paper-border-color)}.root{@mixin light{--paper-border-color:var(--color-gray-3)}}.root{@mixin dark{--paper-border-color:var(--color-slate-7)}}
25
+ .root{--paper-radius:var(--radius-default);--paper-shadow:none;background-color:var(--color-body);border-radius:var(--paper-radius);box-shadow:var(--paper-shadow);display:block;outline:0;text-decoration:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.root:where([data-with-border]){border:rem(1px) solid var(--paper-border-color)}.root{@mixin light{--paper-border-color:var(--color-gray-3)}}.root{@mixin dark{--paper-border-color:var(--color-dark-7)}}
26
26
  </style>
@@ -0,0 +1,2 @@
1
+ export declare function pinValidate(code: string, type: 'alphanumeric' | 'number' | RegExp): boolean;
2
+ export declare function createPinArray(length: number, value: string): string[];
@@ -0,0 +1,19 @@
1
+ const regex = {
2
+ number: /^\d+$/,
3
+ alphanumeric: /^[a-z0-9]+$/i
4
+ };
5
+ export function pinValidate(code, type) {
6
+ const re = type instanceof RegExp ? type : regex[type] ?? null;
7
+ return re?.test(code);
8
+ }
9
+ export function createPinArray(length, value) {
10
+ if (length < 1)
11
+ return [];
12
+ const values = Array.from({ length }).fill("");
13
+ if (value) {
14
+ const splitted = value.trim().split("");
15
+ for (let i = 0; i < Math.min(length, splitted.length); i += 1)
16
+ values[i] = splitted[i] === " " ? "" : splitted[i];
17
+ }
18
+ return values;
19
+ }
@@ -0,0 +1,55 @@
1
+ import type { NuanceRadius, NuanceSize, NuanceSpacing } from '../../types/index.js';
2
+ import type { BoxProps } from '../box.vue.js';
3
+ export interface PinInputEmits {
4
+ complete: [value: string];
5
+ }
6
+ export interface PinInputProps extends BoxProps {
7
+ /** Id auto-generated if not provided */
8
+ id?: string;
9
+ /** Hidden input `name` attribute */
10
+ name?: string;
11
+ /** Key of `theme.spacing` or any valid CSS value to set `gap` between inputs, numbers are converted to rem @default 'md' */
12
+ gap?: NuanceSpacing;
13
+ /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem @default 'md' */
14
+ radius?: NuanceRadius;
15
+ /** Controls inputs `width` and `height` @default 'sm' */
16
+ size?: NuanceSize;
17
+ /** If set, the first input is focused when component is mounted @default false */
18
+ autoFocus?: boolean;
19
+ /** Inputs placeholder */
20
+ placeholder?: string;
21
+ /** Determines whether focus should be moved automatically to the next input once filled @default true */
22
+ manageFocus?: boolean;
23
+ /** Determines whether `autocomplete="one-time-code"` attribute should be set on all inputs @default true */
24
+ otp?: boolean;
25
+ /** Adds disabled attribute to all inputs */
26
+ disabled?: boolean;
27
+ /** Sets `aria-invalid` attribute and applies error styles to all inputs */
28
+ error?: boolean;
29
+ /** Determines which values can be entered @default 'alphanumeric' */
30
+ type?: 'alphanumeric' | 'number' | RegExp;
31
+ /** Changes input type to `"password"` @default false */
32
+ mask?: boolean;
33
+ /** Number of inputs @default 4 */
34
+ length?: number;
35
+ /** If set, the user cannot edit the value */
36
+ readOnly?: boolean;
37
+ /** `aria-label` attribute */
38
+ ariaLabel?: string;
39
+ /** Marks the field as required */
40
+ required?: boolean;
41
+ }
42
+ type __VLS_Props = PinInputProps;
43
+ type __VLS_ModelProps = {
44
+ modelValue?: string;
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: string) => any;
49
+ complete: (value: string) => any;
50
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
51
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
52
+ onComplete?: ((value: string) => any) | undefined;
53
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
+ declare const _default: typeof __VLS_export;
55
+ export default _default;