@nswds/app 3.0.2 → 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" }) }),
@@ -12905,7 +12900,9 @@ function ContextMenuShortcut({ className, ...props }) {
12905
12900
  }
12906
12901
  );
12907
12902
  }
12908
- function DataTablePagination({ table }) {
12903
+ function DataTablePagination({
12904
+ table
12905
+ }) {
12909
12906
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-2", children: [
12910
12907
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 text-sm text-muted-foreground", children: [
12911
12908
  table.getFilteredSelectedRowModel().rows.length,
@@ -12920,12 +12917,12 @@ function DataTablePagination({ table }) {
12920
12917
  /* @__PURE__ */ jsxRuntime.jsxs(
12921
12918
  Select,
12922
12919
  {
12923
- value: `${table.getState().pagination.pageSize}`,
12920
+ value: `${table.state.pagination.pageSize}`,
12924
12921
  onValueChange: (value) => {
12925
12922
  table.setPageSize(Number(value));
12926
12923
  },
12927
12924
  children: [
12928
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
12925
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: table.state.pagination.pageSize }) }),
12929
12926
  /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
12930
12927
  ]
12931
12928
  }
@@ -12933,7 +12930,7 @@ function DataTablePagination({ table }) {
12933
12930
  ] }),
12934
12931
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
12935
12932
  "Page ",
12936
- table.getState().pagination.pageIndex + 1,
12933
+ table.state.pagination.pageIndex + 1,
12937
12934
  " of ",
12938
12935
  table.getPageCount()
12939
12936
  ] }),
@@ -13098,7 +13095,9 @@ function DataTableFacetedFilter({
13098
13095
  ] }) })
13099
13096
  ] });
13100
13097
  }
13101
- function DataTableViewOptions({ table }) {
13098
+ function DataTableViewOptions({
13099
+ table
13100
+ }) {
13102
13101
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
13103
13102
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button2, { variant: "outline", size: "sm", className: "nsw:ml-auto nsw:hidden nsw:lg:flex", children: [
13104
13103
  /* @__PURE__ */ jsxRuntime.jsx(Icons.tune, {}),
@@ -13151,8 +13150,12 @@ function Input({ className, type, ...props }) {
13151
13150
  }
13152
13151
  );
13153
13152
  }
13154
- function DataTableToolbar({ search, toolbar, table }) {
13155
- const isFiltered = table.getState().columnFilters.length > 0;
13153
+ function DataTableToolbar({
13154
+ search,
13155
+ toolbar,
13156
+ table
13157
+ }) {
13158
+ const isFiltered = table.state.columnFilters.length > 0;
13156
13159
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
13157
13160
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center space-x-2", children: [
13158
13161
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -13161,7 +13164,7 @@ function DataTableToolbar({ search, toolbar, table }) {
13161
13164
  type: "search",
13162
13165
  name: "global-filter",
13163
13166
  placeholder: search?.placeholder ?? `Filter...`,
13164
- value: table.getState().globalFilter ?? "",
13167
+ value: table.state.globalFilter ?? "",
13165
13168
  onChange: (event) => table.setGlobalFilter(event.target.value),
13166
13169
  className: "h-10 w-[184px] lg:w-[280px]"
13167
13170
  }
@@ -13265,6 +13268,22 @@ function TableCaption({ className, ...props }) {
13265
13268
  }
13266
13269
  );
13267
13270
  }
13271
+ var dataTableFeatures = reactTable.tableFeatures({
13272
+ rowSortingFeature: reactTable.rowSortingFeature,
13273
+ columnFilteringFeature: reactTable.columnFilteringFeature,
13274
+ globalFilteringFeature: reactTable.globalFilteringFeature,
13275
+ columnVisibilityFeature: reactTable.columnVisibilityFeature,
13276
+ rowSelectionFeature: reactTable.rowSelectionFeature,
13277
+ rowPaginationFeature: reactTable.rowPaginationFeature,
13278
+ columnFacetingFeature: reactTable.columnFacetingFeature,
13279
+ sortedRowModel: reactTable.createSortedRowModel(),
13280
+ filteredRowModel: reactTable.createFilteredRowModel(),
13281
+ paginatedRowModel: reactTable.createPaginatedRowModel(),
13282
+ facetedRowModel: reactTable.createFacetedRowModel(),
13283
+ facetedUniqueValues: reactTable.createFacetedUniqueValues(),
13284
+ filterFns: reactTable.filterFns,
13285
+ sortFns: reactTable.sortFns
13286
+ });
13268
13287
  function DataTable({
13269
13288
  search,
13270
13289
  toolbar,
@@ -13277,7 +13296,8 @@ function DataTable({
13277
13296
  const [columnFilters, setColumnFilters] = React5__namespace.useState([]);
13278
13297
  const [sorting, setSorting] = React5__namespace.useState(initialSorting);
13279
13298
  const [globalFilter, setGlobalFilter] = React5__namespace.useState("");
13280
- const table = reactTable.useReactTable({
13299
+ const table = reactTable.useTable({
13300
+ features: dataTableFeatures,
13281
13301
  data,
13282
13302
  columns,
13283
13303
  state: {
@@ -13288,18 +13308,14 @@ function DataTable({
13288
13308
  columnFilters
13289
13309
  },
13290
13310
  enableRowSelection: true,
13311
+ // v9 enables shift-click range selection by default; keep v8 behavior
13312
+ enableRowRangeSelection: false,
13291
13313
  onRowSelectionChange: setRowSelection,
13292
13314
  onSortingChange: setSorting,
13293
13315
  onColumnFiltersChange: setColumnFilters,
13294
13316
  onColumnVisibilityChange: setColumnVisibility,
13295
13317
  onGlobalFilterChange: setGlobalFilter,
13296
- globalFilterFn: "includesString",
13297
- getCoreRowModel: reactTable.getCoreRowModel(),
13298
- getFilteredRowModel: reactTable.getFilteredRowModel(),
13299
- getPaginationRowModel: reactTable.getPaginationRowModel(),
13300
- getSortedRowModel: reactTable.getSortedRowModel(),
13301
- getFacetedRowModel: reactTable.getFacetedRowModel(),
13302
- getFacetedUniqueValues: reactTable.getFacetedUniqueValues()
13318
+ globalFilterFn: "includesString"
13303
13319
  });
13304
13320
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 p-1", children: [
13305
13321
  /* @__PURE__ */ jsxRuntime.jsx(DataTableToolbar, { table, search, toolbar }),
@@ -14469,7 +14485,7 @@ function FormatToggle({ format, setFormat }) {
14469
14485
 
14470
14486
  // package.json
14471
14487
  var package_default = {
14472
- version: "3.0.2"};
14488
+ version: "4.0.1"};
14473
14489
  var SluggerContext = React5__namespace.default.createContext(null);
14474
14490
  function flattenText(nodes) {
14475
14491
  if (nodes == null || typeof nodes === "boolean") return "";
@@ -21427,7 +21443,9 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
21427
21443
  }
21428
21444
 
21429
21445
  // node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs
21430
- var cssMotionPathProperties = [
21446
+ var cssStyleProperties = [
21447
+ "transform",
21448
+ "opacity",
21431
21449
  "offsetDistance",
21432
21450
  "offsetPath",
21433
21451
  "offsetRotate",
@@ -21453,9 +21471,11 @@ function buildSVGAttrs(state, {
21453
21471
  state.attrs = state.style;
21454
21472
  state.style = {};
21455
21473
  const { attrs, style } = state;
21456
- if (attrs.transform) {
21457
- style.transform = attrs.transform;
21458
- 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
+ }
21459
21479
  }
21460
21480
  if (style.transform || attrs.transformOrigin) {
21461
21481
  style.transformOrigin = attrs.transformOrigin ?? "50% 50%";
@@ -21465,12 +21485,6 @@ function buildSVGAttrs(state, {
21465
21485
  style.transformBox = styleProp?.transformBox ?? "fill-box";
21466
21486
  delete attrs.transformBox;
21467
21487
  }
21468
- for (const key of cssMotionPathProperties) {
21469
- if (attrs[key] !== void 0) {
21470
- style[key] = attrs[key];
21471
- delete attrs[key];
21472
- }
21473
- }
21474
21488
  if (attrX !== void 0)
21475
21489
  attrs.x = attrX;
21476
21490
  if (attrY !== void 0)
@@ -21548,6 +21562,12 @@ var SVGVisualElement = class extends DOMVisualElement {
21548
21562
  const defaultType = getDefaultValueType(key);
21549
21563
  return defaultType ? defaultType.default || 0 : 0;
21550
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
+ }
21551
21571
  key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
21552
21572
  return instance.getAttribute(key);
21553
21573
  }
@@ -23437,71 +23457,6 @@ function loadFeatures(features) {
23437
23457
  }
23438
23458
  setFeatureDefinitions(featureDefinitions2);
23439
23459
  }
23440
-
23441
- // node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
23442
- var validMotionProps = /* @__PURE__ */ new Set([
23443
- "animate",
23444
- "exit",
23445
- "variants",
23446
- "initial",
23447
- "style",
23448
- "values",
23449
- "variants",
23450
- "transition",
23451
- "transformTemplate",
23452
- "custom",
23453
- "inherit",
23454
- "onBeforeLayoutMeasure",
23455
- "onAnimationStart",
23456
- "onAnimationComplete",
23457
- "onUpdate",
23458
- "onDragStart",
23459
- "onDrag",
23460
- "onDragEnd",
23461
- "onMeasureDragConstraints",
23462
- "onDirectionLock",
23463
- "onDragTransitionEnd",
23464
- "_dragX",
23465
- "_dragY",
23466
- "onHoverStart",
23467
- "onHoverEnd",
23468
- "onViewportEnter",
23469
- "onViewportLeave",
23470
- "globalTapTarget",
23471
- "propagate",
23472
- "ignoreStrict",
23473
- "viewport"
23474
- ]);
23475
- function isValidMotionProp(key) {
23476
- return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
23477
- }
23478
-
23479
- // node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
23480
- var shouldForward = (key) => !isValidMotionProp(key);
23481
- function loadExternalIsValidProp(isValidProp) {
23482
- if (typeof isValidProp !== "function")
23483
- return;
23484
- shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
23485
- }
23486
- try {
23487
- const emotionPkg = "@emotion/is-prop-valid";
23488
- loadExternalIsValidProp(__require(emotionPkg).default);
23489
- } catch {
23490
- }
23491
- function filterProps(props, isDom, forwardMotionProps) {
23492
- const filteredProps = {};
23493
- for (const key in props) {
23494
- if (key === "values" && typeof props.values === "object")
23495
- continue;
23496
- if (isMotionValue(props[key]))
23497
- continue;
23498
- if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
23499
- props["draggable"] && key.startsWith("onDrag")) {
23500
- filteredProps[key] = props[key];
23501
- }
23502
- }
23503
- return filteredProps;
23504
- }
23505
23460
  var MotionContext = /* @__PURE__ */ React5.createContext({});
23506
23461
 
23507
23462
  // node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
@@ -23594,6 +23549,63 @@ function useSVGProps(props, visualState, _isStatic, Component2) {
23594
23549
  return visualProps;
23595
23550
  }
23596
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
+
23597
23609
  // node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs
23598
23610
  var lowercaseSVGElements = [
23599
23611
  "animate",
@@ -23651,10 +23663,10 @@ function isSVGComponent(Component2) {
23651
23663
  }
23652
23664
 
23653
23665
  // node_modules/framer-motion/dist/es/render/dom/use-render.mjs
23654
- function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG) {
23666
+ function useRender(Component2, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {
23655
23667
  const useVisualProps = isSVG ?? isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
23656
23668
  const visualProps = useVisualProps(props, latestValues, isStatic, Component2);
23657
- const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
23669
+ const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps, isValidProp);
23658
23670
  const elementProps = Component2 !== React5.Fragment ? { ...filteredProps, ...visualProps, ref } : {};
23659
23671
  const { children } = props;
23660
23672
  const renderedChildren = React5.useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
@@ -23879,7 +23891,7 @@ function createMotionComponent(Component2, { forwardMotionProps = false, type }
23879
23891
  ...props,
23880
23892
  layoutId: useLayoutId(props)
23881
23893
  };
23882
- const { isStatic } = configAndProps;
23894
+ const { isStatic, isValidProp } = configAndProps;
23883
23895
  const context = useCreateMotionContext(props);
23884
23896
  const visualState = useVisualState(props, isStatic);
23885
23897
  if (!isStatic && typeof window !== "undefined") {
@@ -23888,7 +23900,7 @@ function createMotionComponent(Component2, { forwardMotionProps = false, type }
23888
23900
  MeasureLayout2 = layoutProjection.MeasureLayout;
23889
23901
  context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);
23890
23902
  }
23891
- 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)] });
23892
23904
  }
23893
23905
  MotionDOMComponent.displayName = `motion.${typeof Component2 === "string" ? Component2 : `create(${Component2.displayName ?? Component2.name ?? ""})`}`;
23894
23906
  const ForwardRefMotionComponent = React5.forwardRef(MotionDOMComponent);
@@ -32287,6 +32299,7 @@ exports.createColorArray = createColorArray;
32287
32299
  exports.createColorData = createColorData;
32288
32300
  exports.createFormStore = createFormStore;
32289
32301
  exports.darkenColor = darkenColor;
32302
+ exports.dataTableFeatures = dataTableFeatures;
32290
32303
  exports.diverging = diverging;
32291
32304
  exports.domToSimple = domToSimple;
32292
32305
  exports.focusInput = focusInput;