@nubisco/ui 5.32.0 → 5.33.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 (126) hide show
  1. package/dist/{AiLabel-oCXAwOV7.cjs → AiLabel-BK3oecvT.cjs} +1 -1
  2. package/dist/{AiLabel--bFL3RGP.js → AiLabel-CPINOrQd.js} +1 -1
  3. package/dist/{AiProvider-Hcn5HI7d.cjs → AiProvider-CXkNWwzy.cjs} +1 -1
  4. package/dist/{AiProvider-e52qwD9B.js → AiProvider-TIZP0M_z.js} +3 -3
  5. package/dist/{Briefing-B3DkTnx2.js → Briefing-BhnZ6WVQ.js} +2 -2
  6. package/dist/{Briefing-j9BVOjgG.cjs → Briefing-CZ2bGU7N.cjs} +1 -1
  7. package/dist/Card-BL1xYcGm.cjs +1 -0
  8. package/dist/Card-CZ520vKr.js +107 -0
  9. package/dist/{ColorStrip-BU-ulOHD.js → ColorStrip-Cvg8SDbi.js} +1 -1
  10. package/dist/{ColorStrip-BYyRIRcm.cjs → ColorStrip-D9Y0q4F3.cjs} +1 -1
  11. package/dist/{Confirm-D4efGS9N.js → Confirm-PX-ztREx.js} +2 -2
  12. package/dist/{Confirm-dbr67RaT.cjs → Confirm-f5dXOogg.cjs} +1 -1
  13. package/dist/{DataTable-Crff50H9.js → DataTable-pqZtxJyw.js} +1 -1
  14. package/dist/{DataTable-CEn_t_gK.cjs → DataTable-pukt9JVj.cjs} +1 -1
  15. package/dist/{DatePicker-BE8UNh5e.cjs → DatePicker-BtQGKawo.cjs} +1 -1
  16. package/dist/{DatePicker-DdC1K_r4.js → DatePicker-D-V0rt-j.js} +1 -1
  17. package/dist/{Form-CCIMliw5.cjs → Form-CTlKzud3.cjs} +1 -1
  18. package/dist/{Form-C6D7J3uE.js → Form-CU8I3tRi.js} +1 -1
  19. package/dist/{Grid-Hbvbu16k.js → Grid-CJFQvcko.js} +1 -1
  20. package/dist/{Grid-CDrItyQ7.cjs → Grid-CXE0B85G.cjs} +1 -1
  21. package/dist/{ImageCropper-BdB5u2KL.js → ImageCropper-DJdFeFEa.js} +1 -1
  22. package/dist/{ImageCropper-ujxFwNFt.cjs → ImageCropper-DsPY_FK-.cjs} +1 -1
  23. package/dist/Layer-BPC6XSrP.cjs +1 -0
  24. package/dist/Layer-BgL2sFav.js +26 -0
  25. package/dist/{Modal-B5o-iCST.cjs → Modal-BsjO-Q-K.cjs} +1 -1
  26. package/dist/{Modal-DmNuqKOf.js → Modal-CN35LB5_.js} +1 -1
  27. package/dist/{Pagination-R0xsDurI.js → Pagination-DyoObjwm.js} +1 -1
  28. package/dist/{Pagination-DC0orqR2.cjs → Pagination-zLxu_xGl.cjs} +1 -1
  29. package/dist/ReorderList-BuUYPJMK.js +183 -0
  30. package/dist/ReorderList-bFHn97rx.cjs +1 -0
  31. package/dist/{Select-Rt3Y2VD4.js → Select-Djtr68yO.js} +1 -1
  32. package/dist/{Select-CjkBXtFi.cjs → Select-tqEDoa5r.cjs} +1 -1
  33. package/dist/{ShellPanel-7EmMevry.cjs → ShellPanel-COJIhqCY.cjs} +1 -1
  34. package/dist/{ShellPanel-6slzyDrP.js → ShellPanel-Dway28Hw.js} +1 -1
  35. package/dist/{Slider-YLBEViRc.js → Slider-CUonOhgJ.js} +1 -1
  36. package/dist/{Slider-NUU1SB6V.cjs → Slider-CojrFGb_.cjs} +1 -1
  37. package/dist/{Stat-DqRpuO4B.js → Stat-Bt5qWXgo.js} +6 -6
  38. package/dist/Stat-NMsu1A9e.cjs +1 -0
  39. package/dist/{Switch-CZUy_hrg.js → Switch-8zEBXjF9.js} +1 -1
  40. package/dist/{Switch-BNIi6Xxq.cjs → Switch-D6Yh4B_9.cjs} +1 -1
  41. package/dist/{TextInput-BaRumauo.js → TextInput-D5vlfecS.js} +1 -1
  42. package/dist/{TextInput-bj61DMdd.cjs → TextInput-IAk1KYb5.cjs} +1 -1
  43. package/dist/all.cjs +1 -1
  44. package/dist/all.mjs +21 -21
  45. package/dist/components/AiLabel.cjs +1 -1
  46. package/dist/components/AiLabel.mjs +1 -1
  47. package/dist/components/AiProvider.cjs +1 -1
  48. package/dist/components/AiProvider.mjs +1 -1
  49. package/dist/components/Briefing.cjs +1 -1
  50. package/dist/components/Briefing.mjs +1 -1
  51. package/dist/components/Card.cjs +1 -1
  52. package/dist/components/Card.mjs +1 -1
  53. package/dist/components/Card.vue.d.ts +13 -6
  54. package/dist/components/Card.vue.d.ts.map +1 -1
  55. package/dist/components/CardGrid.d.ts +29 -0
  56. package/dist/components/ColorStrip.cjs +1 -1
  57. package/dist/components/ColorStrip.mjs +1 -1
  58. package/dist/components/Confirm.cjs +1 -1
  59. package/dist/components/Confirm.mjs +1 -1
  60. package/dist/components/DataTable.cjs +1 -1
  61. package/dist/components/DataTable.mjs +1 -1
  62. package/dist/components/DatePicker.cjs +1 -1
  63. package/dist/components/DatePicker.mjs +1 -1
  64. package/dist/components/Form.cjs +1 -1
  65. package/dist/components/Form.mjs +1 -1
  66. package/dist/components/Grid.cjs +1 -1
  67. package/dist/components/Grid.mjs +1 -1
  68. package/dist/components/Grid.vue.d.ts.map +1 -1
  69. package/dist/components/ImageCropper.cjs +1 -1
  70. package/dist/components/ImageCropper.mjs +1 -1
  71. package/dist/components/Layer.cjs +1 -1
  72. package/dist/components/Layer.d.ts +3 -2
  73. package/dist/components/Layer.mjs +1 -1
  74. package/dist/components/Layer.vue.d.ts +2 -3
  75. package/dist/components/Layer.vue.d.ts.map +1 -1
  76. package/dist/components/Modal.cjs +1 -1
  77. package/dist/components/Modal.mjs +1 -1
  78. package/dist/components/Pagination.cjs +1 -1
  79. package/dist/components/Pagination.mjs +1 -1
  80. package/dist/components/ReorderList.cjs +1 -1
  81. package/dist/components/ReorderList.mjs +1 -1
  82. package/dist/components/ReorderList.vue.d.ts.map +1 -1
  83. package/dist/components/Select.cjs +1 -1
  84. package/dist/components/Select.mjs +1 -1
  85. package/dist/components/ShellPanel.cjs +1 -1
  86. package/dist/components/ShellPanel.mjs +1 -1
  87. package/dist/components/ShellPanel.vue.d.ts.map +1 -1
  88. package/dist/components/Slider.cjs +1 -1
  89. package/dist/components/Slider.mjs +1 -1
  90. package/dist/components/Stat.cjs +1 -1
  91. package/dist/components/Stat.d.ts +6 -2
  92. package/dist/components/Stat.mjs +1 -1
  93. package/dist/components/Stat.vue.d.ts +1 -1
  94. package/dist/components/Stat.vue.d.ts.map +1 -1
  95. package/dist/components/Switch.cjs +1 -1
  96. package/dist/components/Switch.mjs +1 -1
  97. package/dist/components/TextInput.cjs +1 -1
  98. package/dist/components/TextInput.mjs +1 -1
  99. package/dist/composables/useConfirm.composable.cjs +1 -1
  100. package/dist/composables/useConfirm.composable.mjs +3 -3
  101. package/dist/composables/useSurfaceLayer.composable.cjs +1 -1
  102. package/dist/composables/useSurfaceLayer.composable.d.ts +10 -1
  103. package/dist/composables/useSurfaceLayer.composable.d.ts.map +1 -1
  104. package/dist/composables/useSurfaceLayer.composable.mjs +23 -19
  105. package/dist/index.cjs +1 -1
  106. package/dist/index.mjs +21 -21
  107. package/dist/styles/Button.css +1 -1
  108. package/dist/styles/Card.css +1 -1
  109. package/dist/styles/FileUploader.css +1 -1
  110. package/dist/styles/ReorderList.css +1 -1
  111. package/dist/styles/ShellPanel.css +1 -1
  112. package/dist/styles/Stat.css +1 -1
  113. package/dist/ui.css +6 -6
  114. package/package.json +1 -1
  115. package/src/styles/_theme-api.scss +31 -13
  116. package/src/styles/_theme.scss +16 -15
  117. package/src/styles/grid/_mixins.scss +26 -3
  118. package/src/styles/grid/index.scss +5 -0
  119. package/src/styles/logic/_ink.scss +54 -15
  120. package/dist/Card-4l_DbIKC.cjs +0 -1
  121. package/dist/Card-BBXSjH58.js +0 -74
  122. package/dist/Layer-BLOx5Oh8.js +0 -20
  123. package/dist/Layer-DOnWnKYV.cjs +0 -1
  124. package/dist/ReorderList-BpJaGDDA.cjs +0 -1
  125. package/dist/ReorderList-DvPkvpFU.js +0 -181
  126. package/dist/Stat-CHBimwPd.cjs +0 -1
@@ -1,34 +1,73 @@
1
+ @use 'sass:map';
2
+
1
3
  /// A semantic colour drawn as ink: text, an outline or an icon set directly on a
2
4
  /// surface, with no fill of its own behind it.
3
5
  ///
4
6
  /// The semantic colours (`--nb-c-primary`, `--nb-c-secondary`, ...) are picked
5
7
  /// first as FILLS, with their `-a11y` foreground on top. Drawn straight onto a
6
- /// surface they are a different pair, and in the dark theme several of them do
7
- /// not survive it: the dark secondary is a mid grey chosen to carry white text,
8
- /// and as the label of an outlined button it measured 1.21:1 to 2.15:1 against
9
- /// the four dark layers.
8
+ /// surface they are a different pair, and several of them do not survive it.
9
+ /// In dark mode the secondary is a mid grey chosen to carry white text, and as
10
+ /// the label of an outlined button it measured 1.21:1 to 2.15:1 on the dark
11
+ /// layers. In light mode the warning amber measured 1.75:1 to 2.06:1, and the
12
+ /// success green 2.69:1 to 3.16:1.
10
13
  ///
11
- /// So ink lifts the colour toward white by `--nb-c-<variant>-ink-lift`. The
12
- /// light theme does not declare the lift, so the fallback of 0% returns the
13
- /// colour unchanged and light mode is pixel-identical. The dark theme declares
14
- /// one per variant, each the smallest lift that clears WCAG AA (4.5:1) on all
15
- /// four dark layers and on the 14% wash an outlined button paints when pressed.
16
- /// `tests/inkContrast.test.ts` measures it.
14
+ /// So ink moves the colour away from the surface: toward
15
+ /// `--nb-c-ink-toward` (black in light mode, white in dark) by
16
+ /// `--nb-c-<variant>-ink-lift`. Each lift is the smallest whole value that
17
+ /// clears WCAG AA (4.5:1) on all four layers of its theme, and on the 8% hover
18
+ /// and 14% pressed washes an outlined button paints under its own label, plus
19
+ /// two points of margin. A variant that already clears it has no lift.
20
+ /// `tests/inkContrast.test.ts` measures every one.
17
21
  ///
18
22
  /// The mix is resolved on the element that paints, not at `:root`, so a product
19
23
  /// that re-points `--nb-c-primary` (on `:root` or on a themed subtree) gets ITS
20
- /// primary lifted, never the library's. A named theme that sets its own dark
21
- /// colour for a variant resets that variant's lift to 0%, because it chose that
22
- /// colour for contrast already (see `theme()` in `_theme-api.scss`).
24
+ /// primary moved, never the library's. A named theme that sets its own colour
25
+ /// for a variant resets that variant's lift to 0% in that mode, because it chose
26
+ /// that colour for contrast already (see `theme()` in `_theme-api.scss`).
23
27
  ///
28
+ /// @group @nubisco/colors
29
+
30
+ /// Light-theme lifts, toward black.
31
+ /// @type Map
32
+ $light-lifts: (
33
+ success: 34%,
34
+ info: 14%,
35
+ warning: 46%,
36
+ danger: 22%,
37
+ );
38
+
39
+ /// Dark-theme lifts, toward white.
40
+ /// @type Map
41
+ $dark-lifts: (
42
+ primary: 48%,
43
+ secondary: 56%,
44
+ success: 21%,
45
+ info: 43%,
46
+ warning: 6%,
47
+ danger: 46%,
48
+ );
49
+
50
+ /// The variants ink applies to.
51
+ $variants: primary, secondary, success, info, warning, danger;
52
+
53
+ /// Declares one theme's lifts. Variants absent from the map get 0%, written
54
+ /// out, so a theme scope never inherits the other mode's value.
55
+ ///
56
+ /// @param {Map} $lifts - `$light-lifts` or `$dark-lifts`
57
+ @mixin lifts($lifts) {
58
+ @each $variant in $variants {
59
+ --nb-c-#{$variant}-ink-lift: #{map.get($lifts, $variant) or 0%};
60
+ }
61
+ }
62
+
24
63
  /// @param {String} $variant - primary, secondary, success, info, warning or danger
25
64
  /// @return {String} a `color-mix()` expression
26
65
  /// @access public
27
- /// @group @nubisco/colors
28
66
  @function ink($variant) {
29
67
  @return color-mix(
30
68
  in srgb,
31
69
  var(--nb-c-#{$variant}),
32
- var(--nb-c-white) var(--nb-c-#{$variant}-ink-lift, 0%)
70
+ var(--nb-c-ink-toward, var(--nb-c-white))
71
+ var(--nb-c-#{$variant}-ink-lift, 0%)
33
72
  );
34
73
  }
@@ -1 +0,0 @@
1
- require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Icon-C8R_r_In.cjs`),n=require(`./composables/useSurfaceLayer.composable.cjs`),r=require(`./Card.link-CPtMC-Hu.cjs`);let i=require(`vue`);var a={key:0,class:`nb-card__icon`},o={class:`nb-card__head`},s={class:`nb-card__title`},c={key:0,class:`nb-card__subtitle`},l={key:1,class:`nb-card__body`},u={key:2,class:`nb-card__footer`},d=(0,i.defineComponent)({__name:`Card`,props:{title:{default:``},subtitle:{default:``},icon:{default:void 0},href:{default:void 0},to:{default:void 0},target:{default:void 0},clickable:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`select`],setup(e,{emit:d}){let f=e,p=d,{layerProps:m}=n.useSurfaceLayer(),{tag:h,attrs:g,isInteractive:_,onClick:v,onKeydown:y}=r.t(f,()=>p(`select`));return(n,r)=>((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)((0,i.unref)(h)),(0,i.mergeProps)({class:[`nb-card`,{"nb-card--interactive":(0,i.unref)(_),"nb-card--selected":e.selected,"nb-card--disabled":e.disabled}]},{...(0,i.unref)(g),...(0,i.unref)(m)},{onClick:(0,i.unref)(v),onKeydown:(0,i.unref)(y)}),{default:(0,i.withCtx)(()=>[e.icon||n.$slots.icon?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,a,[(0,i.renderSlot)(n.$slots,`icon`,{},()=>[(0,i.createVNode)(t.t,{name:e.icon,size:20,"aria-hidden":`true`},null,8,[`name`])],!0)])):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`div`,o,[(0,i.createElementVNode)(`span`,s,[(0,i.renderSlot)(n.$slots,`title`,{},()=>[(0,i.createTextVNode)((0,i.toDisplayString)(e.title),1)],!0)]),e.subtitle||n.$slots.subtitle?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,c,[(0,i.renderSlot)(n.$slots,`subtitle`,{},()=>[(0,i.createTextVNode)((0,i.toDisplayString)(e.subtitle),1)],!0)])):(0,i.createCommentVNode)(``,!0)]),n.$slots.default?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,l,[(0,i.renderSlot)(n.$slots,`default`,{},void 0,!0)])):(0,i.createCommentVNode)(``,!0),n.$slots.footer?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,u,[(0,i.renderSlot)(n.$slots,`footer`,{},void 0,!0)])):(0,i.createCommentVNode)(``,!0)]),_:3},16,[`class`,`onClick`,`onKeydown`]))}}),f=e.t(d,[[`__scopeId`,`data-v-117532d8`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
@@ -1,74 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
2
- import { t } from "./Icon-rREAqsu0.js";
3
- import { useSurfaceLayer as n } from "./composables/useSurfaceLayer.composable.mjs";
4
- import { t as r } from "./Card.link-CfeswzHY.js";
5
- import { createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, openBlock as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
6
- //#region src/components/Card.vue?vue&type=script&setup=true&lang.ts
7
- var v = {
8
- key: 0,
9
- class: "nb-card__icon"
10
- }, y = { class: "nb-card__head" }, b = { class: "nb-card__title" }, x = {
11
- key: 0,
12
- class: "nb-card__subtitle"
13
- }, S = {
14
- key: 1,
15
- class: "nb-card__body"
16
- }, C = {
17
- key: 2,
18
- class: "nb-card__footer"
19
- }, w = /* @__PURE__ */ e(/* @__PURE__ */ u({
20
- __name: "Card",
21
- props: {
22
- title: { default: "" },
23
- subtitle: { default: "" },
24
- icon: { default: void 0 },
25
- href: { default: void 0 },
26
- to: { default: void 0 },
27
- target: { default: void 0 },
28
- clickable: {
29
- type: Boolean,
30
- default: !1
31
- },
32
- selected: {
33
- type: Boolean,
34
- default: !1
35
- },
36
- disabled: {
37
- type: Boolean,
38
- default: !1
39
- }
40
- },
41
- emits: ["select"],
42
- setup(e, { emit: u }) {
43
- let w = e, T = u, { layerProps: E } = n(), { tag: D, attrs: O, isInteractive: k, onClick: A, onKeydown: j } = r(w, () => T("select"));
44
- return (n, r) => (f(), i(m(g(D)), d({ class: ["nb-card", {
45
- "nb-card--interactive": g(k),
46
- "nb-card--selected": e.selected,
47
- "nb-card--disabled": e.disabled
48
- }] }, {
49
- ...g(O),
50
- ...g(E)
51
- }, {
52
- onClick: g(A),
53
- onKeydown: g(j)
54
- }), {
55
- default: _(() => [
56
- e.icon || n.$slots.icon ? (f(), o("div", v, [p(n.$slots, "icon", {}, () => [l(t, {
57
- name: e.icon,
58
- size: 20,
59
- "aria-hidden": "true"
60
- }, null, 8, ["name"])], !0)])) : a("", !0),
61
- s("div", y, [s("span", b, [p(n.$slots, "title", {}, () => [c(h(e.title), 1)], !0)]), e.subtitle || n.$slots.subtitle ? (f(), o("span", x, [p(n.$slots, "subtitle", {}, () => [c(h(e.subtitle), 1)], !0)])) : a("", !0)]),
62
- n.$slots.default ? (f(), o("div", S, [p(n.$slots, "default", {}, void 0, !0)])) : a("", !0),
63
- n.$slots.footer ? (f(), o("div", C, [p(n.$slots, "footer", {}, void 0, !0)])) : a("", !0)
64
- ]),
65
- _: 3
66
- }, 16, [
67
- "class",
68
- "onClick",
69
- "onKeydown"
70
- ]));
71
- }
72
- }), [["__scopeId", "data-v-117532d8"]]);
73
- //#endregion
74
- export { w as t };
@@ -1,20 +0,0 @@
1
- import { NB_LAYER_INJECTION_KEY as e, clampLayer as t, layerClassFor as n } from "./composables/useSurfaceLayer.composable.mjs";
2
- import { computed as r, createBlock as i, defineComponent as a, inject as o, normalizeClass as s, openBlock as c, provide as l, renderSlot as u, resolveDynamicComponent as d, withCtx as f } from "vue";
3
- //#endregion
4
- //#region src/components/Layer.vue
5
- var p = /* @__PURE__ */ a({
6
- __name: "Layer",
7
- props: {
8
- level: { default: void 0 },
9
- as: { default: "div" }
10
- },
11
- setup(a) {
12
- let p = a, m = o(e, null), h = r(() => p.level === void 0 ? t((m ? m.value : 1) + 1) : t(p.level)), g = r(() => n(h.value));
13
- return l(e, r(() => h.value)), (e, t) => (c(), i(d(a.as), { class: s(g.value) }, {
14
- default: f(() => [u(e.$slots, "default", { level: h.value })]),
15
- _: 3
16
- }, 8, ["class"]));
17
- }
18
- });
19
- //#endregion
20
- export { p as t };
@@ -1 +0,0 @@
1
- require(`./chunk-D-qHiVGv.cjs`);const e=require(`./composables/useSurfaceLayer.composable.cjs`);let t=require(`vue`);var n=(0,t.defineComponent)({__name:`Layer`,props:{level:{default:void 0},as:{default:`div`}},setup(n){let r=n,i=(0,t.inject)(e.NB_LAYER_INJECTION_KEY,null),a=(0,t.computed)(()=>r.level===void 0?e.clampLayer((i?i.value:1)+1):e.clampLayer(r.level)),o=(0,t.computed)(()=>e.layerClassFor(a.value));return(0,t.provide)(e.NB_LAYER_INJECTION_KEY,(0,t.computed)(()=>a.value)),(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.as),{class:(0,t.normalizeClass)(o.value)},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`,{level:a.value})]),_:3},8,[`class`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -1 +0,0 @@
1
- require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Icon-C8R_r_In.cjs`),n=require(`./composables/useStableId.composable.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/dots-six-vertical`);var a=[`aria-label`,`aria-describedby`],o=[`data-index`,`onPointerdown`],s=[`tabindex`,`aria-disabled`,`aria-label`,`onKeydown`,`onBlur`],c={class:`nb-reorder-list__content`},l=[`id`],u={class:`nb-reorder-list__sr`,"aria-live":`assertive`},d=(0,r.defineComponent)({__name:`ReorderList`,props:{modelValue:{default:()=>[]},itemKey:{type:[String,Function],default:void 0},handle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:``}},emits:[`update:modelValue`,`reorder`],setup(e,{emit:d}){let f=e,p=d,m=n.useStableId({}),h=(0,r.ref)(null),g=(0,r.computed)(()=>f.modelValue);function _(e,t){let n=f.itemKey;return typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]:t}function v(e){let t=g.value[e];if(t&&typeof t==`object`){let e=t,n=e.label??e.name??e.title;if(typeof n==`string`)return n}return String(t??`Item ${e+1}`)}function y(e){let t=`${v(e)}, ${e+1} of ${g.value.length}`;return S.value===e?`${t}, picked up`:t}let b=(0,r.ref)(``);function x(e,t,n){if(e===t||e<0||t<0)return;let r=[...g.value],[i]=r.splice(e,1);r.splice(t,0,i),p(`update:modelValue`,r),p(`reorder`,{from:e,to:t,via:n}),b.value=`${v(e)} moved to position ${t+1} of ${r.length}`}let S=(0,r.ref)(null);function C(e,t){if(f.disabled)return;if(e.key===`Escape`&&S.value!==null){e.preventDefault(),S.value=null,b.value=`Move cancelled`;return}if(e.key===` `||e.key===`Enter`){e.preventDefault(),S.value===t?(S.value=null,b.value=`${v(t)} dropped at position ${t+1}`):(S.value=t,b.value=`${v(t)} picked up, position ${t+1} of ${g.value.length}`);return}let n=e.key===`ArrowUp`?-1:e.key===`ArrowDown`?1:0;if(!n)return;e.preventDefault();let r=t+n;r<0||r>=g.value.length||(S.value===t?(x(t,r,`keyboard`),S.value=r,w(r)):w(r))}async function w(e){await Promise.resolve(),(h.value?.querySelector(`[data-index="${e}"] .nb-reorder-list__grab`))?.focus()}function T(e){S.value===e&&(S.value=null)}let E=(0,r.ref)(null),D=(0,r.ref)(null);function O(e,t){if(f.disabled||e.button!==0)return;let n=e.target,r=!!n.closest(`.nb-reorder-list__grab`);if(!(f.handle&&!r)&&!(!r&&n.closest(`button, a, input, select, textarea`))&&!(e.pointerType===`touch`&&!r)&&!(E.value!==null&&e.pointerId!==k)){if(S.value=null,E.value=t,D.value=t,k=e.pointerId,e.pointerType&&e.pointerType!==`mouse`){let t=n.closest(`.nb-reorder-list__grab`);try{t?.setPointerCapture?.(e.pointerId)}catch{}}M(),window.addEventListener(`pointermove`,P),window.addEventListener(`pointerup`,F),window.addEventListener(`pointercancel`,I)}}let k;function A(e){return e.pointerId===k}let j=null;function M(){typeof document>`u`||j!==null||(j=document.body.style.userSelect,document.body.style.userSelect=`none`,document.body.style.setProperty(`-webkit-user-select`,`none`))}function N(){typeof document>`u`||j===null||(document.body.style.userSelect=j,document.body.style.removeProperty(`-webkit-user-select`),j=null)}function P(e){if(E.value===null||!h.value||!A(e))return;let t=[...h.value.querySelectorAll(`[data-index]`)],n=t.length;for(let r of t){let t=r.getBoundingClientRect();if(e.clientY<t.top+t.height/2){n=Number(r.dataset.index);break}}D.value=n}function F(e){if(!A(e))return;let t=E.value,n=D.value;L(),!(t===null||n===null)&&x(t,n>t?n-1:n,`pointer`)}function I(e){A(e)&&L()}function L(){N(),E.value=null,D.value=null,k=void 0,window.removeEventListener(`pointermove`,P),window.removeEventListener(`pointerup`,F),window.removeEventListener(`pointercancel`,I)}return(0,r.onBeforeUnmount)(L),(n,d)=>((0,r.openBlock)(),(0,r.createElementBlock)(`ul`,{ref_key:`listRef`,ref:h,class:(0,r.normalizeClass)([`nb-reorder-list`,{"nb-reorder-list--dragging":E.value!==null}]),role:`list`,"aria-label":e.label||void 0,"aria-describedby":`${(0,r.unref)(m)}-hint`},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(g.value,(a,l)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:_(a,l),class:(0,r.normalizeClass)([`nb-reorder-list__row`,{"nb-reorder-list__row--dragging":E.value===l,"nb-reorder-list__row--lifted":S.value===l,"nb-reorder-list__row--drop-before":D.value===l,"nb-reorder-list__row--drop-after":D.value===l+1&&l===g.value.length-1}]),"data-index":l,onPointerdown:e=>O(e,l)},[(0,r.createElementVNode)(`div`,{class:`nb-reorder-list__grab`,tabindex:e.disabled?-1:0,role:`button`,"aria-disabled":e.disabled||void 0,"aria-label":y(l),onKeydown:e=>C(e,l),onBlur:e=>T(l)},[(0,r.renderSlot)(n.$slots,`handle`,{item:a,index:l},()=>[(0,r.createVNode)(t.t,{class:`nb-reorder-list__grip`,name:(0,r.unref)(i.regular),size:16,"aria-hidden":`true`},null,8,[`name`])],!0)],40,s),(0,r.createElementVNode)(`div`,c,[(0,r.renderSlot)(n.$slots,`default`,{item:a,index:l},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(a),1)],!0)])],42,o))),128)),(0,r.createElementVNode)(`li`,{id:`${(0,r.unref)(m)}-hint`,class:`nb-reorder-list__sr`},` Press Space or Enter to pick up, arrow keys to move, Space or Enter to drop, Escape to cancel. `,8,l),(0,r.createElementVNode)(`li`,u,(0,r.toDisplayString)(b.value),1)],10,a))}}),f=e.t(d,[[`__scopeId`,`data-v-a6037f51`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
@@ -1,181 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
2
- import { t } from "./Icon-rREAqsu0.js";
3
- import { useStableId as n } from "./composables/useStableId.composable.mjs";
4
- import { Fragment as r, computed as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _ } from "vue";
5
- import { regular as v } from "@nubisco/ui/icons/dots-six-vertical";
6
- //#region src/components/ReorderList.vue?vue&type=script&setup=true&lang.ts
7
- var y = ["aria-label", "aria-describedby"], b = ["data-index", "onPointerdown"], x = [
8
- "tabindex",
9
- "aria-disabled",
10
- "aria-label",
11
- "onKeydown",
12
- "onBlur"
13
- ], S = { class: "nb-reorder-list__content" }, C = ["id"], w = {
14
- class: "nb-reorder-list__sr",
15
- "aria-live": "assertive"
16
- }, T = /* @__PURE__ */ e(/* @__PURE__ */ l({
17
- __name: "ReorderList",
18
- props: {
19
- modelValue: { default: () => [] },
20
- itemKey: {
21
- type: [String, Function],
22
- default: void 0
23
- },
24
- handle: {
25
- type: Boolean,
26
- default: !1
27
- },
28
- disabled: {
29
- type: Boolean,
30
- default: !1
31
- },
32
- label: { default: "" }
33
- },
34
- emits: ["update:modelValue", "reorder"],
35
- setup(e, { emit: l }) {
36
- let T = e, E = l, D = n({}), O = p(null), k = i(() => T.modelValue);
37
- function A(e, t) {
38
- let n = T.itemKey;
39
- return typeof n == "function" ? n(e, t) : typeof n == "string" ? e?.[n] : t;
40
- }
41
- function j(e) {
42
- let t = k.value[e];
43
- if (t && typeof t == "object") {
44
- let e = t, n = e.label ?? e.name ?? e.title;
45
- if (typeof n == "string") return n;
46
- }
47
- return String(t ?? `Item ${e + 1}`);
48
- }
49
- function M(e) {
50
- let t = `${j(e)}, ${e + 1} of ${k.value.length}`;
51
- return F.value === e ? `${t}, picked up` : t;
52
- }
53
- let N = p("");
54
- function P(e, t, n) {
55
- if (e === t || e < 0 || t < 0) return;
56
- let r = [...k.value], [i] = r.splice(e, 1);
57
- r.splice(t, 0, i), E("update:modelValue", r), E("reorder", {
58
- from: e,
59
- to: t,
60
- via: n
61
- }), N.value = `${j(e)} moved to position ${t + 1} of ${r.length}`;
62
- }
63
- let F = p(null);
64
- function I(e, t) {
65
- if (T.disabled) return;
66
- if (e.key === "Escape" && F.value !== null) {
67
- e.preventDefault(), F.value = null, N.value = "Move cancelled";
68
- return;
69
- }
70
- if (e.key === " " || e.key === "Enter") {
71
- e.preventDefault(), F.value === t ? (F.value = null, N.value = `${j(t)} dropped at position ${t + 1}`) : (F.value = t, N.value = `${j(t)} picked up, position ${t + 1} of ${k.value.length}`);
72
- return;
73
- }
74
- let n = e.key === "ArrowUp" ? -1 : e.key === "ArrowDown" ? 1 : 0;
75
- if (!n) return;
76
- e.preventDefault();
77
- let r = t + n;
78
- r < 0 || r >= k.value.length || (F.value === t ? (P(t, r, "keyboard"), F.value = r, L(r)) : L(r));
79
- }
80
- async function L(e) {
81
- await Promise.resolve(), (O.value?.querySelector(`[data-index="${e}"] .nb-reorder-list__grab`))?.focus();
82
- }
83
- function R(e) {
84
- F.value === e && (F.value = null);
85
- }
86
- let z = p(null), B = p(null);
87
- function V(e, t) {
88
- if (T.disabled || e.button !== 0) return;
89
- let n = e.target, r = !!n.closest(".nb-reorder-list__grab");
90
- if (!(T.handle && !r) && !(!r && n.closest("button, a, input, select, textarea")) && !(e.pointerType === "touch" && !r) && !(z.value !== null && e.pointerId !== H)) {
91
- if (F.value = null, z.value = t, B.value = t, H = e.pointerId, e.pointerType && e.pointerType !== "mouse") {
92
- let t = n.closest(".nb-reorder-list__grab");
93
- try {
94
- t?.setPointerCapture?.(e.pointerId);
95
- } catch {}
96
- }
97
- G(), window.addEventListener("pointermove", q), window.addEventListener("pointerup", J), window.addEventListener("pointercancel", Y);
98
- }
99
- }
100
- let H;
101
- function U(e) {
102
- return e.pointerId === H;
103
- }
104
- let W = null;
105
- function G() {
106
- typeof document > "u" || W !== null || (W = document.body.style.userSelect, document.body.style.userSelect = "none", document.body.style.setProperty("-webkit-user-select", "none"));
107
- }
108
- function K() {
109
- typeof document > "u" || W === null || (document.body.style.userSelect = W, document.body.style.removeProperty("-webkit-user-select"), W = null);
110
- }
111
- function q(e) {
112
- if (z.value === null || !O.value || !U(e)) return;
113
- let t = [...O.value.querySelectorAll("[data-index]")], n = t.length;
114
- for (let r of t) {
115
- let t = r.getBoundingClientRect();
116
- if (e.clientY < t.top + t.height / 2) {
117
- n = Number(r.dataset.index);
118
- break;
119
- }
120
- }
121
- B.value = n;
122
- }
123
- function J(e) {
124
- if (!U(e)) return;
125
- let t = z.value, n = B.value;
126
- X(), !(t === null || n === null) && P(t, n > t ? n - 1 : n, "pointer");
127
- }
128
- function Y(e) {
129
- U(e) && X();
130
- }
131
- function X() {
132
- K(), z.value = null, B.value = null, H = void 0, window.removeEventListener("pointermove", q), window.removeEventListener("pointerup", J), window.removeEventListener("pointercancel", Y);
133
- }
134
- return d(X), (n, i) => (f(), a("ul", {
135
- ref_key: "listRef",
136
- ref: O,
137
- class: u(["nb-reorder-list", { "nb-reorder-list--dragging": z.value !== null }]),
138
- role: "list",
139
- "aria-label": e.label || void 0,
140
- "aria-describedby": `${_(D)}-hint`
141
- }, [
142
- (f(!0), a(r, null, m(k.value, (r, i) => (f(), a("li", {
143
- key: A(r, i),
144
- class: u(["nb-reorder-list__row", {
145
- "nb-reorder-list__row--dragging": z.value === i,
146
- "nb-reorder-list__row--lifted": F.value === i,
147
- "nb-reorder-list__row--drop-before": B.value === i,
148
- "nb-reorder-list__row--drop-after": B.value === i + 1 && i === k.value.length - 1
149
- }]),
150
- "data-index": i,
151
- onPointerdown: (e) => V(e, i)
152
- }, [o("div", {
153
- class: "nb-reorder-list__grab",
154
- tabindex: e.disabled ? -1 : 0,
155
- role: "button",
156
- "aria-disabled": e.disabled || void 0,
157
- "aria-label": M(i),
158
- onKeydown: (e) => I(e, i),
159
- onBlur: (e) => R(i)
160
- }, [h(n.$slots, "handle", {
161
- item: r,
162
- index: i
163
- }, () => [c(t, {
164
- class: "nb-reorder-list__grip",
165
- name: _(v),
166
- size: 16,
167
- "aria-hidden": "true"
168
- }, null, 8, ["name"])], !0)], 40, x), o("div", S, [h(n.$slots, "default", {
169
- item: r,
170
- index: i
171
- }, () => [s(g(r), 1)], !0)])], 42, b))), 128)),
172
- o("li", {
173
- id: `${_(D)}-hint`,
174
- class: "nb-reorder-list__sr"
175
- }, " Press Space or Enter to pick up, arrow keys to move, Space or Enter to drop, Escape to cancel. ", 8, C),
176
- o("li", w, g(N.value), 1)
177
- ], 10, y));
178
- }
179
- }), [["__scopeId", "data-v-a6037f51"]]);
180
- //#endregion
181
- export { T as t };
@@ -1 +0,0 @@
1
- const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/useSurfaceLayer.composable.cjs`),i=require(`./Card.link-CPtMC-Hu.cjs`),a=require(`./Skeleton-CSRjBPVt.cjs`);let o=require(`vue`),s=require(`@nubisco/ui/icons/arrow-up-right`);s=e.n(s);let c=require(`@nubisco/ui/icons/arrow-down-right`);c=e.n(c);let l=require(`@nubisco/ui/icons/minus`);l=e.n(l);var u={class:`nb-stat__label`},d={class:`nb-stat__value`},f={key:1},p={key:2,class:`nb-stat__comparison`},m=(0,o.defineComponent)({__name:`Stat`,props:{label:{},value:{default:void 0},status:{default:`neutral`},delta:{default:void 0},trend:{default:void 0},invertTrend:{type:Boolean,default:!1},comparison:{default:void 0},size:{default:`md`},loading:{type:Boolean,default:!1},to:{default:void 0},href:{default:void 0},target:{default:void 0},clickable:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`select`],setup(e,{emit:t}){let m=e,h=t,{layerProps:g}=r.useSurfaceLayer(),{tag:_,attrs:v,isInteractive:y,onClick:b,onKeydown:x}=i.t(m,()=>h(`select`)),S=(0,o.computed)(()=>m.trend===`up`?s:m.trend===`down`?c:m.trend===`flat`?l:null),C=(0,o.computed)(()=>m.trend===`up`?m.invertTrend?`negative`:`positive`:m.trend===`down`?m.invertTrend?`positive`:`negative`:`neutral`);return(t,r)=>((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)((0,o.unref)(_)),(0,o.mergeProps)({class:[`nb-stat`,[`nb-stat--${e.status}`,`nb-stat--${e.size}`,{"nb-stat--interactive":(0,o.unref)(y),"nb-stat--selected":e.selected,"nb-stat--disabled":e.disabled}]]},{...(0,o.unref)(v),...(0,o.unref)(g)},{"aria-busy":e.loading?!0:void 0,onClick:(0,o.unref)(b),onKeydown:(0,o.unref)(x)}),{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`span`,u,[(0,o.renderSlot)(t.$slots,`label`,{},()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.label),1)],!0)]),(0,o.createElementVNode)(`span`,d,[e.loading?((0,o.openBlock)(),(0,o.createBlock)(a.t,{key:0,variant:`block`,height:e.size===`lg`?36:28,width:`4.5ch`,radius:`sm`},null,8,[`height`])):(0,o.renderSlot)(t.$slots,`value`,{key:1},()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.value),1)],!0)]),!e.loading&&(e.delta||e.trend||e.comparison||t.$slots.delta)?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,{key:0,class:(0,o.normalizeClass)([`nb-stat__delta`,e.trend?`nb-stat__delta--${C.value}`:null])},[(0,o.renderSlot)(t.$slots,`delta`,{},()=>[S.value?((0,o.openBlock)(),(0,o.createBlock)(n.t,{key:0,name:S.value,size:12,class:`nb-stat__trend`,"aria-hidden":`true`},null,8,[`name`])):(0,o.createCommentVNode)(``,!0),e.delta?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,f,(0,o.toDisplayString)(e.delta),1)):(0,o.createCommentVNode)(``,!0),e.comparison?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,p,(0,o.toDisplayString)(e.comparison),1)):(0,o.createCommentVNode)(``,!0)],!0)],2)):(0,o.createCommentVNode)(``,!0)]),_:3},16,[`class`,`aria-busy`,`onClick`,`onKeydown`]))}}),h=t.t(m,[[`__scopeId`,`data-v-ff54027c`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});