@strands.gg/accui 2.15.12 → 2.15.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as _export_sfc, S as StrandsUiButton, U as UiButtonContent, a as _sfc_main$G, b as _sfc_main$H, c as _sfc_main$I, d as createLucideIcon, M as Minus, e as StrandsUiCard, f as UiTooltip, g as UiDivider, u as useFloatingPosition, C as ChevronDown, h as StrandsUiInput, i as StrandsUiLoader, j as StrandsUiTabs, k as StrandsUiLink, l as StrandsUiAlert } from "./StrandsUIPlugin-JP858JzQ.es.js";
2
- import { m } from "./StrandsUIPlugin-JP858JzQ.es.js";
3
- import { defineComponent, computed, provide, onMounted, onUnmounted, createElementBlock, openBlock, normalizeClass, createElementVNode, createBlock, renderSlot, Teleport, createCommentVNode, toDisplayString, createTextVNode, ref, reactive, watch, withModifiers, createStaticVNode, createVNode, withDirectives, withCtx, unref, vModelText, nextTick, Fragment, Transition, createSlots, normalizeStyle, renderList, mergeProps, useSlots, inject, resolveDynamicComponent, onBeforeUnmount, withKeys, h, isMemoSame, getCurrentInstance } from "vue";
1
+ import { _ as _export_sfc, S as StrandsUiButton, U as UiButtonContent, a as _sfc_main$G, b as _sfc_main$H, c as _sfc_main$I, d as createLucideIcon, M as Minus, e as StrandsUiCard, f as UiTooltip, g as UiDivider, u as useFloatingPosition, C as ChevronDown, h as StrandsUiInput, i as StrandsUiLoader, j as StrandsUiTabs, k as StrandsUiLink, l as StrandsUiAlert } from "./StrandsUIPlugin-Dws5Nqi_.es.js";
2
+ import { m } from "./StrandsUIPlugin-Dws5Nqi_.es.js";
3
+ import { defineComponent, computed, provide, onMounted, onUnmounted, createElementBlock, openBlock, normalizeClass, createElementVNode, createBlock, renderSlot, Teleport, createCommentVNode, toDisplayString, ref, watch, createTextVNode, reactive, withModifiers, createStaticVNode, createVNode, withDirectives, withCtx, unref, vModelText, nextTick, Fragment, Transition, createSlots, normalizeStyle, renderList, mergeProps, useSlots, inject, resolveDynamicComponent, onBeforeUnmount, withKeys, h, isMemoSame, getCurrentInstance } from "vue";
4
4
  import { u as useStrandsConfig, p as provideStrandsConfig } from "./useStrandsConfig-fRu-OG08.es.js";
5
5
  import { s } from "./useStrandsConfig-fRu-OG08.es.js";
6
6
  import { u as useStrandsAuth } from "./useStrandsAuth-BCnUxo-R.es.js";
@@ -216,34 +216,60 @@ const _hoisted_4$u = ["id", "aria-pressed", "aria-labelledby"];
216
216
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
217
217
  __name: "UiToggle",
218
218
  props: {
219
- modelValue: { type: Boolean, default: false },
219
+ modelValue: { type: Boolean, default: void 0 },
220
+ checked: { type: [Boolean, String], default: void 0 },
220
221
  disabled: { type: Boolean, default: false },
221
222
  id: {},
222
223
  label: {},
223
224
  required: { type: Boolean }
224
225
  },
225
- emits: ["update:modelValue"],
226
+ emits: ["update:modelValue", "change"],
226
227
  setup(__props, { emit: __emit }) {
227
228
  const props = __props;
228
229
  const emit = __emit;
230
+ const internalValue = ref(false);
231
+ const isChecked = computed(() => {
232
+ if (props.modelValue !== void 0) {
233
+ return Boolean(props.modelValue);
234
+ }
235
+ if (props.checked !== void 0) {
236
+ if (typeof props.checked === "string") {
237
+ return props.checked === "" || props.checked === "true";
238
+ }
239
+ return Boolean(props.checked);
240
+ }
241
+ return internalValue.value;
242
+ });
243
+ watch(() => props.checked, (newVal) => {
244
+ if (newVal !== void 0) {
245
+ if (typeof newVal === "string") {
246
+ internalValue.value = newVal === "" || newVal === "true";
247
+ } else {
248
+ internalValue.value = Boolean(newVal);
249
+ }
250
+ }
251
+ }, { immediate: true });
229
252
  const toggleId = computed(() => props.id || `ui-toggle-${Math.random().toString(36).substr(2, 9)}`);
230
253
  const toggleClasses = computed(() => [
231
254
  "ui-toggle",
232
255
  {
233
- "ui-toggle--on": props.modelValue,
234
- "ui-toggle--off": !props.modelValue,
256
+ "ui-toggle--on": isChecked.value,
257
+ "ui-toggle--off": !isChecked.value,
235
258
  "ui-toggle--disabled": props.disabled
236
259
  }
237
260
  ]);
238
261
  const thumbClasses = computed(() => [
239
262
  {
240
- "ui-toggle-thumb--on": props.modelValue,
241
- "ui-toggle-thumb--off": !props.modelValue
263
+ "ui-toggle-thumb--on": isChecked.value,
264
+ "ui-toggle-thumb--off": !isChecked.value
242
265
  }
243
266
  ]);
244
267
  const handleToggle = () => {
245
268
  if (props.disabled) return;
246
- emit("update:modelValue", !props.modelValue);
269
+ const newValue = !isChecked.value;
270
+ internalValue.value = newValue;
271
+ emit("update:modelValue", newValue);
272
+ emit("change", newValue);
247
273
  };
248
274
  return (_ctx, _cache) => {
249
275
  return openBlock(), createElementBlock("div", _hoisted_1$B, [
@@ -259,7 +285,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
259
285
  id: toggleId.value,
260
286
  type: "button",
261
287
  class: normalizeClass(toggleClasses.value),
262
- "aria-pressed": _ctx.modelValue,
288
+ "aria-pressed": isChecked.value,
263
289
  "aria-labelledby": _ctx.label ? `${toggleId.value}-label` : void 0,
264
290
  onClick: handleToggle
265
291
  }, [
@@ -271,7 +297,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
271
297
  };
272
298
  }
273
299
  });
274
- const UiToggle = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-ba05b9e3"]]);
300
+ const UiToggle = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-aefb58fe"]]);
275
301
  const _hoisted_1$A = { class: "accui-component-scope" };
276
302
  const _hoisted_2$v = { class: "avatar-editor-simple" };
277
303
  const _hoisted_3$u = {
@@ -6029,7 +6055,8 @@ const _hoisted_14$f = {
6029
6055
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
6030
6056
  __name: "UiSlider",
6031
6057
  props: {
6032
- modelValue: { default: 0 },
6058
+ modelValue: { default: void 0 },
6059
+ value: { default: void 0 },
6033
6060
  min: { default: 0 },
6034
6061
  max: { default: 100 },
6035
6062
  step: { default: 1 },
@@ -6048,7 +6075,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
6048
6075
  color: { default: "primary" },
6049
6076
  inputId: {}
6050
6077
  },
6051
- emits: ["update:modelValue", "change", "focus", "blur"],
6078
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
6052
6079
  setup(__props, { emit: __emit }) {
6053
6080
  const props = __props;
6054
6081
  const emit = __emit;
@@ -6056,13 +6083,33 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
6056
6083
  const isDragging = ref(false);
6057
6084
  const inputCount = ref(0);
6058
6085
  const dragTimeout = ref(null);
6086
+ const internalValue = ref(0);
6087
+ const currentValue = computed(() => {
6088
+ if (props.modelValue !== void 0) {
6089
+ return Number(props.modelValue);
6090
+ }
6091
+ if (props.value !== void 0) {
6092
+ return Number(props.value);
6093
+ }
6094
+ return internalValue.value;
6095
+ });
6096
+ watch(() => props.value, (newVal) => {
6097
+ if (newVal !== void 0) {
6098
+ internalValue.value = Number(newVal);
6099
+ }
6100
+ }, { immediate: true });
6101
+ watch(() => props.modelValue, (newVal) => {
6102
+ if (newVal !== void 0) {
6103
+ internalValue.value = Number(newVal);
6104
+ }
6105
+ }, { immediate: true });
6059
6106
  const progressPercentage = computed(() => {
6060
6107
  const range = props.max - props.min;
6061
- const value = (props.modelValue - props.min) / range * 100;
6108
+ const value = (currentValue.value - props.min) / range * 100;
6062
6109
  return Math.max(0, Math.min(100, value));
6063
6110
  });
6064
6111
  const displayValue = computed(() => {
6065
- return props.modelValue?.toFixed(props.step < 1 ? 1 : 0) || "0";
6112
+ return currentValue.value?.toFixed(props.step < 1 ? 1 : 0) || "0";
6066
6113
  });
6067
6114
  const sizeClasses = computed(() => {
6068
6115
  return `slider-size-${props.size}`;
@@ -6100,7 +6147,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
6100
6147
  inputCount.value = 0;
6101
6148
  }, 100);
6102
6149
  }
6150
+ internalValue.value = value;
6103
6151
  emit("update:modelValue", value);
6152
+ emit("input", value);
6104
6153
  };
6105
6154
  const handleChange = (event) => {
6106
6155
  const target = event.target;
@@ -6156,7 +6205,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
6156
6205
  ref_key: "sliderRef",
6157
6206
  ref: sliderRef,
6158
6207
  type: "range",
6159
- value: _ctx.modelValue,
6208
+ value: currentValue.value,
6160
6209
  min: _ctx.min,
6161
6210
  max: _ctx.max,
6162
6211
  step: _ctx.step,
@@ -6204,7 +6253,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
6204
6253
  };
6205
6254
  }
6206
6255
  });
6207
- const UiSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-c27d9054"]]);
6256
+ const UiSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-db4748a0"]]);
6208
6257
  const _hoisted_1$r = {
6209
6258
  key: 0,
6210
6259
  class: "radio-group-label"
package/dist/vite.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";function n(n={}){const{styles:s=1,accentColor:r="#EA00A8",useSquircle:t=1,...i}=n;let c;return{name:"@strands.gg/accui:vite-plugin",enforce:"pre",config:(n,{command:s})=>(c={accentColor:r,useSquircle:t,...i},{define:{t:JSON.stringify(c)}}),transformIndexHtml:{order:"pre",handler(n){if(r&&"#EA00A8"!==r){const s=`<style data-strands-accent>\n :root {\n --strands-accent: ${r};\n --accui-strands-accent: ${r};\n --accui-strands-50: color-mix(in srgb, ${r} 10%, white);\n --accui-strands-100: color-mix(in srgb, ${r} 20%, white);\n --accui-strands-200: color-mix(in srgb, ${r} 30%, white);\n --accui-strands-300: color-mix(in srgb, ${r} 40%, white);\n --accui-strands-400: color-mix(in srgb, ${r} 70%, white);\n --accui-strands-500: ${r};\n --accui-strands-600: color-mix(in srgb, ${r} 85%, black);\n --accui-strands-700: color-mix(in srgb, ${r} 70%, black);\n --accui-strands-800: color-mix(in srgb, ${r} 55%, black);\n --accui-strands-900: color-mix(in srgb, ${r} 40%, black);\n --accui-strands-950: color-mix(in srgb, ${r} 25%, black);\n }</style>`;return n.replace("</head>",` ${s}\n </head>`)}return n}},transform:async(n,r)=>(s&&r.endsWith("main.ts")||r.endsWith("main.js"))&&!n.includes("@strands.gg/accui/style.css")?{code:`import '@strands.gg/accui/style.css'\n${n}`,map:null}:!r.endsWith("main.ts")&&!r.endsWith("main.js")||n.includes("setStrandsConfig")||n.includes("__STRANDS_INJECTED__")?null:{code:`\n// Auto-injected by @strands.gg/accui Vite plugin\nimport { setStrandsConfig } from '@strands.gg/accui'\n\nif (typeof window !== 'undefined') {\n const strandsConfig = ${JSON.stringify(c)}\n setStrandsConfig(strandsConfig)\n window.__STRANDS_CONFIG__ = strandsConfig\n window.__STRANDS_INJECTED__ = true\n}\n\n${n}`,map:null}}}Object.defineProperties(exports,{i:{value:1},[Symbol.toStringTag]:{value:"Module"}}),exports.StrandsAuth=n,exports.StrandsAuthVitePlugin=n,exports.createStrandsAuth=function(n={}){return{install(s){Promise.resolve().then(()=>require("./StrandsUIPlugin-DSCUXdBp.cjs.js")).then(n=>n.StrandsUIPlugin$1).then(n=>{const r=n.default;s.use(r)}),Promise.resolve().then(()=>require("./useStrandsConfig-Sr6NG90B.cjs.js")).then(n=>n.useStrandsConfig$1).then(s=>{const{setStrandsConfig:r}=s;r(n),"undefined"!=typeof window&&(window.t=n)})}}},exports.default=n,exports.strandsAuth=n;
1
+ "use strict";function n(n={}){const{styles:s=1,accentColor:r="#EA00A8",useSquircle:t=1,...i}=n;let c;return{name:"@strands.gg/accui:vite-plugin",enforce:"pre",config:(n,{command:s})=>(c={accentColor:r,useSquircle:t,...i},{define:{t:JSON.stringify(c)}}),transformIndexHtml:{order:"pre",handler(n){if(r&&"#EA00A8"!==r){const s=`<style data-strands-accent>\n :root {\n --strands-accent: ${r};\n --accui-strands-accent: ${r};\n --accui-strands-50: color-mix(in srgb, ${r} 10%, white);\n --accui-strands-100: color-mix(in srgb, ${r} 20%, white);\n --accui-strands-200: color-mix(in srgb, ${r} 30%, white);\n --accui-strands-300: color-mix(in srgb, ${r} 40%, white);\n --accui-strands-400: color-mix(in srgb, ${r} 70%, white);\n --accui-strands-500: ${r};\n --accui-strands-600: color-mix(in srgb, ${r} 85%, black);\n --accui-strands-700: color-mix(in srgb, ${r} 70%, black);\n --accui-strands-800: color-mix(in srgb, ${r} 55%, black);\n --accui-strands-900: color-mix(in srgb, ${r} 40%, black);\n --accui-strands-950: color-mix(in srgb, ${r} 25%, black);\n }</style>`;return n.replace("</head>",` ${s}\n </head>`)}return n}},transform:async(n,r)=>(s&&r.endsWith("main.ts")||r.endsWith("main.js"))&&!n.includes("@strands.gg/accui/style.css")?{code:`import '@strands.gg/accui/style.css'\n${n}`,map:null}:!r.endsWith("main.ts")&&!r.endsWith("main.js")||n.includes("setStrandsConfig")||n.includes("__STRANDS_INJECTED__")?null:{code:`\n// Auto-injected by @strands.gg/accui Vite plugin\nimport { setStrandsConfig } from '@strands.gg/accui'\n\nif (typeof window !== 'undefined') {\n const strandsConfig = ${JSON.stringify(c)}\n setStrandsConfig(strandsConfig)\n window.__STRANDS_CONFIG__ = strandsConfig\n window.__STRANDS_INJECTED__ = true\n}\n\n${n}`,map:null}}}Object.defineProperties(exports,{i:{value:1},[Symbol.toStringTag]:{value:"Module"}}),exports.StrandsAuth=n,exports.StrandsAuthVitePlugin=n,exports.createStrandsAuth=function(n={}){return{install(s){Promise.resolve().then(()=>require("./StrandsUIPlugin-D9RVai-I.cjs.js")).then(n=>n.StrandsUIPlugin$1).then(n=>{const r=n.default;s.use(r)}),Promise.resolve().then(()=>require("./useStrandsConfig-Sr6NG90B.cjs.js")).then(n=>n.useStrandsConfig$1).then(s=>{const{setStrandsConfig:r}=s;r(n),"undefined"!=typeof window&&(window.t=n)})}}},exports.default=n,exports.strandsAuth=n;
package/dist/vite.es.js CHANGED
@@ -86,7 +86,7 @@ ${code}`,
86
86
  function createStrandsAuth(config = {}) {
87
87
  return {
88
88
  install(app) {
89
- import("./StrandsUIPlugin-JP858JzQ.es.js").then((n) => n.n).then((module) => {
89
+ import("./StrandsUIPlugin-Dws5Nqi_.es.js").then((n) => n.n).then((module) => {
90
90
  const StrandsUIPlugin = module.default;
91
91
  app.use(StrandsUIPlugin);
92
92
  });
@@ -11,9 +11,10 @@ export declare const baseStyles = "\n :host {\n /* Typography */\n --accu
11
11
  *
12
12
  * @param tagName - The custom element tag name (e.g., 'strands-button')
13
13
  * @param component - The Vue component to convert
14
- * @param additionalStyles - Optional additional CSS to inject
14
+ * @param dependencyStyles - Optional array of CSS strings from dependent components
15
+ * (injected by the Vite build plugin)
15
16
  */
16
- export declare function registerCustomElement(tagName: string, component: Component, additionalStyles?: string): void;
17
+ export declare function registerCustomElement(tagName: string, component: Component, dependencyStyles?: string[]): void;
17
18
  /**
18
19
  * Check if a custom element is already registered
19
20
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strands.gg/accui",
3
- "version": "2.15.12",
3
+ "version": "2.15.14",
4
4
  "description": "Strands Authentication UI Components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",