@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.js CHANGED
@@ -72,12 +72,7 @@ import { slugifyWithCounter } from '@sindresorhus/slugify';
72
72
  import { create } from 'zustand';
73
73
  import { persist, createJSONStorage } from 'zustand/middleware';
74
74
 
75
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
76
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
77
- }) : x)(function(x) {
78
- if (typeof require !== "undefined") return require.apply(this, arguments);
79
- throw Error('Dynamic require of "' + x + '" is not supported');
80
- });
75
+ // src/components/Accordion.tsx
81
76
  var Icons = {
82
77
  _10k: (props) => /* @__PURE__ */ jsx("svg", { fill: "currentColor", "data-slot": "icon", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ 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" }) }),
83
78
  _10mp: (props) => /* @__PURE__ */ jsx("svg", { fill: "currentColor", "data-slot": "icon", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ 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" }) }),
@@ -14435,7 +14430,7 @@ function FormatToggle({ format, setFormat }) {
14435
14430
 
14436
14431
  // package.json
14437
14432
  var package_default = {
14438
- version: "4.0.0"};
14433
+ version: "4.0.1"};
14439
14434
  var SluggerContext = React5__default.createContext(null);
14440
14435
  function flattenText(nodes) {
14441
14436
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -21393,7 +21388,9 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
21393
21388
  }
21394
21389
 
21395
21390
  // node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs
21396
- var cssMotionPathProperties = [
21391
+ var cssStyleProperties = [
21392
+ "transform",
21393
+ "opacity",
21397
21394
  "offsetDistance",
21398
21395
  "offsetPath",
21399
21396
  "offsetRotate",
@@ -21419,9 +21416,11 @@ function buildSVGAttrs(state, {
21419
21416
  state.attrs = state.style;
21420
21417
  state.style = {};
21421
21418
  const { attrs, style } = state;
21422
- if (attrs.transform) {
21423
- style.transform = attrs.transform;
21424
- delete attrs.transform;
21419
+ for (const key of cssStyleProperties) {
21420
+ if (attrs[key] !== void 0) {
21421
+ style[key] = attrs[key];
21422
+ delete attrs[key];
21423
+ }
21425
21424
  }
21426
21425
  if (style.transform || attrs.transformOrigin) {
21427
21426
  style.transformOrigin = attrs.transformOrigin ?? "50% 50%";
@@ -21431,12 +21430,6 @@ function buildSVGAttrs(state, {
21431
21430
  style.transformBox = styleProp?.transformBox ?? "fill-box";
21432
21431
  delete attrs.transformBox;
21433
21432
  }
21434
- for (const key of cssMotionPathProperties) {
21435
- if (attrs[key] !== void 0) {
21436
- style[key] = attrs[key];
21437
- delete attrs[key];
21438
- }
21439
- }
21440
21433
  if (attrX !== void 0)
21441
21434
  attrs.x = attrX;
21442
21435
  if (attrY !== void 0)
@@ -21514,6 +21507,12 @@ var SVGVisualElement = class extends DOMVisualElement {
21514
21507
  const defaultType = getDefaultValueType(key);
21515
21508
  return defaultType ? defaultType.default || 0 : 0;
21516
21509
  }
21510
+ if (cssStyleProperties.includes(key)) {
21511
+ const computedStyle = getComputedStyle(instance);
21512
+ const value = computedStyle[key];
21513
+ if (typeof value === "string" && value)
21514
+ return value.trim();
21515
+ }
21517
21516
  key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
21518
21517
  return instance.getAttribute(key);
21519
21518
  }
@@ -23403,71 +23402,6 @@ function loadFeatures(features) {
23403
23402
  }
23404
23403
  setFeatureDefinitions(featureDefinitions2);
23405
23404
  }
23406
-
23407
- // node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
23408
- var validMotionProps = /* @__PURE__ */ new Set([
23409
- "animate",
23410
- "exit",
23411
- "variants",
23412
- "initial",
23413
- "style",
23414
- "values",
23415
- "variants",
23416
- "transition",
23417
- "transformTemplate",
23418
- "custom",
23419
- "inherit",
23420
- "onBeforeLayoutMeasure",
23421
- "onAnimationStart",
23422
- "onAnimationComplete",
23423
- "onUpdate",
23424
- "onDragStart",
23425
- "onDrag",
23426
- "onDragEnd",
23427
- "onMeasureDragConstraints",
23428
- "onDirectionLock",
23429
- "onDragTransitionEnd",
23430
- "_dragX",
23431
- "_dragY",
23432
- "onHoverStart",
23433
- "onHoverEnd",
23434
- "onViewportEnter",
23435
- "onViewportLeave",
23436
- "globalTapTarget",
23437
- "propagate",
23438
- "ignoreStrict",
23439
- "viewport"
23440
- ]);
23441
- function isValidMotionProp(key) {
23442
- return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
23443
- }
23444
-
23445
- // node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
23446
- var shouldForward = (key) => !isValidMotionProp(key);
23447
- function loadExternalIsValidProp(isValidProp) {
23448
- if (typeof isValidProp !== "function")
23449
- return;
23450
- shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
23451
- }
23452
- try {
23453
- const emotionPkg = "@emotion/is-prop-valid";
23454
- loadExternalIsValidProp(__require(emotionPkg).default);
23455
- } catch {
23456
- }
23457
- function filterProps(props, isDom, forwardMotionProps) {
23458
- const filteredProps = {};
23459
- for (const key in props) {
23460
- if (key === "values" && typeof props.values === "object")
23461
- continue;
23462
- if (isMotionValue(props[key]))
23463
- continue;
23464
- if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
23465
- props["draggable"] && key.startsWith("onDrag")) {
23466
- filteredProps[key] = props[key];
23467
- }
23468
- }
23469
- return filteredProps;
23470
- }
23471
23405
  var MotionContext = /* @__PURE__ */ createContext({});
23472
23406
 
23473
23407
  // node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
@@ -23560,6 +23494,63 @@ function useSVGProps(props, visualState, _isStatic, Component2) {
23560
23494
  return visualProps;
23561
23495
  }
23562
23496
 
23497
+ // node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
23498
+ var validMotionProps = /* @__PURE__ */ new Set([
23499
+ "animate",
23500
+ "exit",
23501
+ "variants",
23502
+ "initial",
23503
+ "style",
23504
+ "values",
23505
+ "variants",
23506
+ "transition",
23507
+ "transformTemplate",
23508
+ "custom",
23509
+ "inherit",
23510
+ "onBeforeLayoutMeasure",
23511
+ "onAnimationStart",
23512
+ "onAnimationComplete",
23513
+ "onUpdate",
23514
+ "onDragStart",
23515
+ "onDrag",
23516
+ "onDragEnd",
23517
+ "onMeasureDragConstraints",
23518
+ "onDirectionLock",
23519
+ "onDragTransitionEnd",
23520
+ "_dragX",
23521
+ "_dragY",
23522
+ "onHoverStart",
23523
+ "onHoverEnd",
23524
+ "onViewportEnter",
23525
+ "onViewportLeave",
23526
+ "globalTapTarget",
23527
+ "propagate",
23528
+ "ignoreStrict",
23529
+ "viewport"
23530
+ ]);
23531
+ function isValidMotionProp(key) {
23532
+ return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
23533
+ }
23534
+
23535
+ // node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
23536
+ function shouldForward(key, isValidProp) {
23537
+ return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp?.(key) ?? !isValidMotionProp(key);
23538
+ }
23539
+ function filterProps(props, isDom, forwardMotionProps, isValidProp) {
23540
+ const filteredProps = {};
23541
+ for (const key in props) {
23542
+ if (key === "values" && typeof props.values === "object")
23543
+ continue;
23544
+ if (isMotionValue(props[key]))
23545
+ continue;
23546
+ if (shouldForward(key, isValidProp) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
23547
+ props["draggable"] && key.startsWith("onDrag")) {
23548
+ filteredProps[key] = props[key];
23549
+ }
23550
+ }
23551
+ return filteredProps;
23552
+ }
23553
+
23563
23554
  // node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs
23564
23555
  var lowercaseSVGElements = [
23565
23556
  "animate",
@@ -23617,10 +23608,10 @@ function isSVGComponent(Component2) {
23617
23608
  }
23618
23609
 
23619
23610
  // node_modules/framer-motion/dist/es/render/dom/use-render.mjs
23620
- function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG) {
23611
+ function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {
23621
23612
  const useVisualProps = isSVG ?? isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
23622
23613
  const visualProps = useVisualProps(props, latestValues, isStatic, Component2);
23623
- const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
23614
+ const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps, isValidProp);
23624
23615
  const elementProps = Component2 !== Fragment$1 ? { ...filteredProps, ...visualProps, ref } : {};
23625
23616
  const { children } = props;
23626
23617
  const renderedChildren = useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
@@ -23845,7 +23836,7 @@ function createMotionComponent(Component2, { forwardMotionProps = false, type }
23845
23836
  ...props,
23846
23837
  layoutId: useLayoutId(props)
23847
23838
  };
23848
- const { isStatic } = configAndProps;
23839
+ const { isStatic, isValidProp } = configAndProps;
23849
23840
  const context = useCreateMotionContext(props);
23850
23841
  const visualState = useVisualState(props, isStatic);
23851
23842
  if (!isStatic && typeof window !== "undefined") {
@@ -23854,7 +23845,7 @@ function createMotionComponent(Component2, { forwardMotionProps = false, type }
23854
23845
  MeasureLayout2 = layoutProjection.MeasureLayout;
23855
23846
  context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);
23856
23847
  }
23857
- return jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsx(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] });
23848
+ return jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsx(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] });
23858
23849
  }
23859
23850
  MotionDOMComponent.displayName = `motion.${typeof Component2 === "string" ? Component2 : `create(${Component2.displayName ?? Component2.name ?? ""})`}`;
23860
23851
  const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);