@nswds/app 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -127,12 +127,7 @@ var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive)
127
127
  var oneDark__default = /*#__PURE__*/_interopDefault(oneDark);
128
128
  var oneLight__default = /*#__PURE__*/_interopDefault(oneLight);
129
129
 
130
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
131
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
132
- }) : x)(function(x) {
133
- if (typeof require !== "undefined") return require.apply(this, arguments);
134
- throw Error('Dynamic require of "' + x + '" is not supported');
135
- });
130
+ // src/components/Accordion.tsx
136
131
  var Icons = {
137
132
  _10k: (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: "currentColor", "data-slot": "icon", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M240-540v150q0 13 8.5 21.5T270-360q13 0 21.5-8.5T300-390v-180q0-13-8.5-21.5T270-600h-40q-13 0-21.5 8.5T200-570q0 13 8.5 21.5T230-540h10Zm140 180h100q17 0 28.5-11.5T520-400v-160q0-17-11.5-28.5T480-600H380q-17 0-28.5 11.5T340-560v160q0 17 11.5 28.5T380-360Zm20-60v-120h60v120h-60Zm217-30 61 79q2 3 23 11 18 0 26-16.5t-3-30.5l-57-73 57-74q11-14 3-30t-26-16q-7 0-13 3t-10 8l-61 79v-60q0-13-8.5-21.5T587-600q-13 0-21.5 8.5T557-570v180q0 13 8.5 21.5T587-360q13 0 21.5-8.5T617-390v-60ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z" }) }),
138
133
  _10mp: (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: "currentColor", "data-slot": "icon", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M340-680v150q0 13 8.5 21.5T370-500q13 0 21.5-8.5T400-530v-180q0-13-8.5-21.5T370-740h-60q-13 0-21.5 8.5T280-710q0 13 8.5 21.5T310-680h30Zm180 180h100q17 0 28.5-11.5T660-540v-160q0-17-11.5-28.5T620-740H520q-17 0-28.5 11.5T480-700v160q0 17 11.5 28.5T520-500Zm20-60v-120h60v120h-60ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Zm100 360h40v90q0 13 8.5 21.5T370-280q13 0 21.5-8.5T400-310v-90h40v150q0 13 8.5 21.5T470-220q13 0 21.5-8.5T500-250v-170q0-17-11.5-28.5T460-460H280q-17 0-28.5 11.5T240-420v170q0 13 8.5 21.5T270-220q13 0 21.5-8.5T300-250v-150Zm300 120h80q17 0 28.5-11.5T720-320v-100q0-17-11.5-28.5T680-460H570q-13 0-21.5 8.5T540-430v180q0 13 8.5 21.5T570-220q13 0 21.5-8.5T600-250v-30Zm0-60v-60h60v60h-60Z" }) }),
@@ -14490,7 +14485,7 @@ function FormatToggle({ format, setFormat }) {
14490
14485
 
14491
14486
  // package.json
14492
14487
  var package_default = {
14493
- version: "4.0.0"};
14488
+ version: "4.0.1"};
14494
14489
  var SluggerContext = React5__namespace.default.createContext(null);
14495
14490
  function flattenText(nodes) {
14496
14491
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -21448,7 +21443,9 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
21448
21443
  }
21449
21444
 
21450
21445
  // node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs
21451
- var cssMotionPathProperties = [
21446
+ var cssStyleProperties = [
21447
+ "transform",
21448
+ "opacity",
21452
21449
  "offsetDistance",
21453
21450
  "offsetPath",
21454
21451
  "offsetRotate",
@@ -21474,9 +21471,11 @@ function buildSVGAttrs(state, {
21474
21471
  state.attrs = state.style;
21475
21472
  state.style = {};
21476
21473
  const { attrs, style } = state;
21477
- if (attrs.transform) {
21478
- style.transform = attrs.transform;
21479
- delete attrs.transform;
21474
+ for (const key of cssStyleProperties) {
21475
+ if (attrs[key] !== void 0) {
21476
+ style[key] = attrs[key];
21477
+ delete attrs[key];
21478
+ }
21480
21479
  }
21481
21480
  if (style.transform || attrs.transformOrigin) {
21482
21481
  style.transformOrigin = attrs.transformOrigin ?? "50% 50%";
@@ -21486,12 +21485,6 @@ function buildSVGAttrs(state, {
21486
21485
  style.transformBox = styleProp?.transformBox ?? "fill-box";
21487
21486
  delete attrs.transformBox;
21488
21487
  }
21489
- for (const key of cssMotionPathProperties) {
21490
- if (attrs[key] !== void 0) {
21491
- style[key] = attrs[key];
21492
- delete attrs[key];
21493
- }
21494
- }
21495
21488
  if (attrX !== void 0)
21496
21489
  attrs.x = attrX;
21497
21490
  if (attrY !== void 0)
@@ -21569,6 +21562,12 @@ var SVGVisualElement = class extends DOMVisualElement {
21569
21562
  const defaultType = getDefaultValueType(key);
21570
21563
  return defaultType ? defaultType.default || 0 : 0;
21571
21564
  }
21565
+ if (cssStyleProperties.includes(key)) {
21566
+ const computedStyle = getComputedStyle(instance);
21567
+ const value = computedStyle[key];
21568
+ if (typeof value === "string" && value)
21569
+ return value.trim();
21570
+ }
21572
21571
  key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
21573
21572
  return instance.getAttribute(key);
21574
21573
  }
@@ -23458,71 +23457,6 @@ function loadFeatures(features) {
23458
23457
  }
23459
23458
  setFeatureDefinitions(featureDefinitions2);
23460
23459
  }
23461
-
23462
- // node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
23463
- var validMotionProps = /* @__PURE__ */ new Set([
23464
- "animate",
23465
- "exit",
23466
- "variants",
23467
- "initial",
23468
- "style",
23469
- "values",
23470
- "variants",
23471
- "transition",
23472
- "transformTemplate",
23473
- "custom",
23474
- "inherit",
23475
- "onBeforeLayoutMeasure",
23476
- "onAnimationStart",
23477
- "onAnimationComplete",
23478
- "onUpdate",
23479
- "onDragStart",
23480
- "onDrag",
23481
- "onDragEnd",
23482
- "onMeasureDragConstraints",
23483
- "onDirectionLock",
23484
- "onDragTransitionEnd",
23485
- "_dragX",
23486
- "_dragY",
23487
- "onHoverStart",
23488
- "onHoverEnd",
23489
- "onViewportEnter",
23490
- "onViewportLeave",
23491
- "globalTapTarget",
23492
- "propagate",
23493
- "ignoreStrict",
23494
- "viewport"
23495
- ]);
23496
- function isValidMotionProp(key) {
23497
- return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
23498
- }
23499
-
23500
- // node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
23501
- var shouldForward = (key) => !isValidMotionProp(key);
23502
- function loadExternalIsValidProp(isValidProp) {
23503
- if (typeof isValidProp !== "function")
23504
- return;
23505
- shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
23506
- }
23507
- try {
23508
- const emotionPkg = "@emotion/is-prop-valid";
23509
- loadExternalIsValidProp(__require(emotionPkg).default);
23510
- } catch {
23511
- }
23512
- function filterProps(props, isDom, forwardMotionProps) {
23513
- const filteredProps = {};
23514
- for (const key in props) {
23515
- if (key === "values" && typeof props.values === "object")
23516
- continue;
23517
- if (isMotionValue(props[key]))
23518
- continue;
23519
- if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
23520
- props["draggable"] && key.startsWith("onDrag")) {
23521
- filteredProps[key] = props[key];
23522
- }
23523
- }
23524
- return filteredProps;
23525
- }
23526
23460
  var MotionContext = /* @__PURE__ */ React5.createContext({});
23527
23461
 
23528
23462
  // node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
@@ -23615,6 +23549,63 @@ function useSVGProps(props, visualState, _isStatic, Component2) {
23615
23549
  return visualProps;
23616
23550
  }
23617
23551
 
23552
+ // node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
23553
+ var validMotionProps = /* @__PURE__ */ new Set([
23554
+ "animate",
23555
+ "exit",
23556
+ "variants",
23557
+ "initial",
23558
+ "style",
23559
+ "values",
23560
+ "variants",
23561
+ "transition",
23562
+ "transformTemplate",
23563
+ "custom",
23564
+ "inherit",
23565
+ "onBeforeLayoutMeasure",
23566
+ "onAnimationStart",
23567
+ "onAnimationComplete",
23568
+ "onUpdate",
23569
+ "onDragStart",
23570
+ "onDrag",
23571
+ "onDragEnd",
23572
+ "onMeasureDragConstraints",
23573
+ "onDirectionLock",
23574
+ "onDragTransitionEnd",
23575
+ "_dragX",
23576
+ "_dragY",
23577
+ "onHoverStart",
23578
+ "onHoverEnd",
23579
+ "onViewportEnter",
23580
+ "onViewportLeave",
23581
+ "globalTapTarget",
23582
+ "propagate",
23583
+ "ignoreStrict",
23584
+ "viewport"
23585
+ ]);
23586
+ function isValidMotionProp(key) {
23587
+ return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
23588
+ }
23589
+
23590
+ // node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
23591
+ function shouldForward(key, isValidProp) {
23592
+ return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp?.(key) ?? !isValidMotionProp(key);
23593
+ }
23594
+ function filterProps(props, isDom, forwardMotionProps, isValidProp) {
23595
+ const filteredProps = {};
23596
+ for (const key in props) {
23597
+ if (key === "values" && typeof props.values === "object")
23598
+ continue;
23599
+ if (isMotionValue(props[key]))
23600
+ continue;
23601
+ if (shouldForward(key, isValidProp) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
23602
+ props["draggable"] && key.startsWith("onDrag")) {
23603
+ filteredProps[key] = props[key];
23604
+ }
23605
+ }
23606
+ return filteredProps;
23607
+ }
23608
+
23618
23609
  // node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs
23619
23610
  var lowercaseSVGElements = [
23620
23611
  "animate",
@@ -23672,10 +23663,10 @@ function isSVGComponent(Component2) {
23672
23663
  }
23673
23664
 
23674
23665
  // node_modules/framer-motion/dist/es/render/dom/use-render.mjs
23675
- function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG) {
23666
+ function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {
23676
23667
  const useVisualProps = isSVG ?? isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
23677
23668
  const visualProps = useVisualProps(props, latestValues, isStatic, Component2);
23678
- const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
23669
+ const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps, isValidProp);
23679
23670
  const elementProps = Component2 !== React5.Fragment ? { ...filteredProps, ...visualProps, ref } : {};
23680
23671
  const { children } = props;
23681
23672
  const renderedChildren = React5.useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
@@ -23900,7 +23891,7 @@ function createMotionComponent(Component2, { forwardMotionProps = false, type }
23900
23891
  ...props,
23901
23892
  layoutId: useLayoutId(props)
23902
23893
  };
23903
- const { isStatic } = configAndProps;
23894
+ const { isStatic, isValidProp } = configAndProps;
23904
23895
  const context = useCreateMotionContext(props);
23905
23896
  const visualState = useVisualState(props, isStatic);
23906
23897
  if (!isStatic && typeof window !== "undefined") {
@@ -23909,7 +23900,7 @@ function createMotionComponent(Component2, { forwardMotionProps = false, type }
23909
23900
  MeasureLayout2 = layoutProjection.MeasureLayout;
23910
23901
  context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);
23911
23902
  }
23912
- return jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsxRuntime.jsx(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] });
23903
+ return jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsxRuntime.jsx(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] });
23913
23904
  }
23914
23905
  MotionDOMComponent.displayName = `motion.${typeof Component2 === "string" ? Component2 : `create(${Component2.displayName ?? Component2.name ?? ""})`}`;
23915
23906
  const ForwardRefMotionComponent = React5.forwardRef(MotionDOMComponent);