@nswds/app 1.21.2 → 1.22.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.
- package/dist/globals.css +229 -181
- package/dist/index.cjs +177 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -11
- package/dist/index.d.ts +75 -11
- package/dist/index.js +133 -100
- package/dist/index.js.map +1 -1
- package/dist/styles.css +246 -202
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import { cva } from 'class-variance-authority';
|
|
|
6
6
|
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
7
7
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
8
8
|
import * as Headless from '@headlessui/react';
|
|
9
|
-
import * as
|
|
10
|
-
import { forwardRef, createContext, useRef, useState,
|
|
9
|
+
import * as React6 from 'react';
|
|
10
|
+
import React6__default, { forwardRef, useEffect, createContext, useRef, useState, useMemo, useCallback, useContext } from 'react';
|
|
11
11
|
import Link3 from 'next/link';
|
|
12
12
|
import * as culori from 'culori';
|
|
13
13
|
import { Slot } from '@radix-ui/react-slot';
|
|
@@ -1809,7 +1809,7 @@ function Breadcrumbs({
|
|
|
1809
1809
|
});
|
|
1810
1810
|
const shouldCollapse = breadcrumbItems.length > maxItems;
|
|
1811
1811
|
if (!shouldCollapse) {
|
|
1812
|
-
return /* @__PURE__ */ jsx(Breadcrumb, { className: "-ml-1", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbItems.map((item, index) => /* @__PURE__ */ jsxs(
|
|
1812
|
+
return /* @__PURE__ */ jsx(Breadcrumb, { className: "-ml-1", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbItems.map((item, index) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
1813
1813
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Link3, { href: item.path, children: item.label }) }) }),
|
|
1814
1814
|
index < breadcrumbItems.length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
|
|
1815
1815
|
] }, item.path)) }) });
|
|
@@ -1820,7 +1820,7 @@ function Breadcrumbs({
|
|
|
1820
1820
|
const itemsAtEnd = breadcrumbItems.slice(-endItems);
|
|
1821
1821
|
const collapsedItems = breadcrumbItems.slice(startItems, breadcrumbItems.length - endItems);
|
|
1822
1822
|
return /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsxs(BreadcrumbList, { children: [
|
|
1823
|
-
itemsAtStart.map((item, index) => /* @__PURE__ */ jsxs(
|
|
1823
|
+
itemsAtStart.map((item, index) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
1824
1824
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Link3, { href: item.path, children: item.label }) }) }),
|
|
1825
1825
|
index < itemsAtStart.length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
|
|
1826
1826
|
] }, item.path)),
|
|
@@ -1833,7 +1833,7 @@ function Breadcrumbs({
|
|
|
1833
1833
|
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", children: collapsedItems.map((item) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx(Link3, { href: item.path, children: item.label }) }, item.path)) })
|
|
1834
1834
|
] }) }),
|
|
1835
1835
|
itemsAtEnd.length > 0 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
1836
|
-
itemsAtEnd.map((item, index) => /* @__PURE__ */ jsxs(
|
|
1836
|
+
itemsAtEnd.map((item, index) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
1837
1837
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Link3, { href: item.path, children: item.label }) }) }),
|
|
1838
1838
|
index < itemsAtEnd.length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {})
|
|
1839
1839
|
] }, item.path))
|
|
@@ -5889,8 +5889,9 @@ var colors = {
|
|
|
5889
5889
|
}
|
|
5890
5890
|
};
|
|
5891
5891
|
var colorThemes = generateColorThemes(colors);
|
|
5892
|
-
function CodeDemo({ data }) {
|
|
5892
|
+
function CodeDemo({ data, hide = {} }) {
|
|
5893
5893
|
const { resolvedTheme } = useTheme();
|
|
5894
|
+
const { rtl = false, darkMode = false, themeSelector = false } = hide;
|
|
5894
5895
|
const [tabIndex, setTabIndex] = useState(0);
|
|
5895
5896
|
const [variant, setVariant] = useState(getInitialVariant(data));
|
|
5896
5897
|
const [view, setView] = useState("desktop");
|
|
@@ -5904,6 +5905,30 @@ function CodeDemo({ data }) {
|
|
|
5904
5905
|
useEffect(() => {
|
|
5905
5906
|
setDarkMode(resolvedTheme === "dark");
|
|
5906
5907
|
}, [resolvedTheme]);
|
|
5908
|
+
const iframeRef = useRef(null);
|
|
5909
|
+
const getShades = (prefix, colorKey, themeCat) => colors[themeCat][colorKey].colors.reduce((acc, shade) => {
|
|
5910
|
+
const suffix = shade.token.split("-").pop();
|
|
5911
|
+
acc[`${prefix}${suffix}`] = shade.hex;
|
|
5912
|
+
return acc;
|
|
5913
|
+
}, {});
|
|
5914
|
+
const themeValues = React6__default.useMemo(
|
|
5915
|
+
() => ({
|
|
5916
|
+
...getShades("primary", primaryColor, themeCategory),
|
|
5917
|
+
...getShades("accent", accentColor, themeCategory)
|
|
5918
|
+
}),
|
|
5919
|
+
[themeCategory, primaryColor, accentColor]
|
|
5920
|
+
);
|
|
5921
|
+
React6__default.useEffect(() => {
|
|
5922
|
+
const frame = iframeRef.current;
|
|
5923
|
+
if (!frame) return;
|
|
5924
|
+
const send = () => {
|
|
5925
|
+
const msg = { type: "nswds-theme", payload: themeValues };
|
|
5926
|
+
frame.contentWindow?.postMessage(msg, "*");
|
|
5927
|
+
};
|
|
5928
|
+
send();
|
|
5929
|
+
frame.addEventListener("load", send);
|
|
5930
|
+
return () => frame.removeEventListener("load", send);
|
|
5931
|
+
}, [themeValues]);
|
|
5907
5932
|
function copyToClipboard(value) {
|
|
5908
5933
|
setJustCopied(true);
|
|
5909
5934
|
navigator.clipboard.writeText(value);
|
|
@@ -5957,7 +5982,7 @@ function CodeDemo({ data }) {
|
|
|
5957
5982
|
/* @__PURE__ */ jsx(EditOnGithubButton, { githubSlug: data.githubSlug }),
|
|
5958
5983
|
/* @__PURE__ */ jsx(ToggleViewButtons, { onSelect: setView }),
|
|
5959
5984
|
/* @__PURE__ */ jsxs("div", { className: "col-span-1 flex justify-end gap-3", children: [
|
|
5960
|
-
/* @__PURE__ */ jsx(
|
|
5985
|
+
!themeSelector && /* @__PURE__ */ jsx(
|
|
5961
5986
|
ThemeSelectorDropDown,
|
|
5962
5987
|
{
|
|
5963
5988
|
themeCategory,
|
|
@@ -5968,8 +5993,8 @@ function CodeDemo({ data }) {
|
|
|
5968
5993
|
setAccentColor
|
|
5969
5994
|
}
|
|
5970
5995
|
),
|
|
5971
|
-
/* @__PURE__ */ jsx(ToggleRTLButton, { isRTL, onClick: () => setIsRTL((state) => !state) }),
|
|
5972
|
-
/* @__PURE__ */ jsx(
|
|
5996
|
+
!rtl && /* @__PURE__ */ jsx(ToggleRTLButton, { isRTL, onClick: () => setIsRTL((state) => !state) }),
|
|
5997
|
+
!darkMode && /* @__PURE__ */ jsx(
|
|
5973
5998
|
ToggleDarkModeButton,
|
|
5974
5999
|
{
|
|
5975
6000
|
isDarkMode,
|
|
@@ -5985,10 +6010,17 @@ function CodeDemo({ data }) {
|
|
|
5985
6010
|
isRTL,
|
|
5986
6011
|
isDarkMode,
|
|
5987
6012
|
iframe: data.iframe,
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
6013
|
+
themeValues,
|
|
6014
|
+
children: data.iframe ? /* @__PURE__ */ jsx(
|
|
6015
|
+
IFrame,
|
|
6016
|
+
{
|
|
6017
|
+
sandbox: "allow-scripts allow-same-origin",
|
|
6018
|
+
ref: iframeRef,
|
|
6019
|
+
data,
|
|
6020
|
+
isRTL,
|
|
6021
|
+
isDarkMode
|
|
6022
|
+
}
|
|
6023
|
+
) : /* @__PURE__ */ jsx(Fragment, { children: data.component })
|
|
5992
6024
|
}
|
|
5993
6025
|
),
|
|
5994
6026
|
/* @__PURE__ */ jsx("div", { className: "code-syntax-wrapper", children: /* @__PURE__ */ jsxs(
|
|
@@ -6033,31 +6065,29 @@ function CodeDemo({ data }) {
|
|
|
6033
6065
|
) })
|
|
6034
6066
|
] });
|
|
6035
6067
|
}
|
|
6036
|
-
|
|
6037
|
-
data,
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
}
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
const finalWidth = width === 100 ? "100%" : width;
|
|
6057
|
-
return /* @__PURE__ */ jsx("iframe", { ref, src: finalSrc, height, width: finalWidth, className: "w-full" });
|
|
6068
|
+
var IFrame = React6__default.forwardRef(
|
|
6069
|
+
({ data, isRTL, isDarkMode }, ref) => {
|
|
6070
|
+
useEffect(() => {
|
|
6071
|
+
const document2 = ref?.current?.contentDocument;
|
|
6072
|
+
const root = document2?.documentElement;
|
|
6073
|
+
if (document2 && root) {
|
|
6074
|
+
root.setAttribute("dir", isRTL ? "rtl" : "ltr");
|
|
6075
|
+
root.classList.toggle("dark", !!isDarkMode);
|
|
6076
|
+
}
|
|
6077
|
+
}, [isRTL, isDarkMode, ref]);
|
|
6078
|
+
if (typeof data.iframe === "number") {
|
|
6079
|
+
return /* @__PURE__ */ jsx("iframe", { ref, src: "", height: data.iframe, width: "100%", className: "w-full" });
|
|
6080
|
+
}
|
|
6081
|
+
if (typeof data.iframe === "object" && data.iframe?.src) {
|
|
6082
|
+
const { src, height = 0, width = 100, noPadding } = data.iframe;
|
|
6083
|
+
const finalSrc = noPadding ? `${src}?noPadding` : src;
|
|
6084
|
+
const finalWidth = width === 100 ? "100%" : width;
|
|
6085
|
+
return /* @__PURE__ */ jsx("iframe", { ref, src: finalSrc, height, width: finalWidth, className: "w-full" });
|
|
6086
|
+
}
|
|
6087
|
+
return null;
|
|
6058
6088
|
}
|
|
6059
|
-
|
|
6060
|
-
|
|
6089
|
+
);
|
|
6090
|
+
IFrame.displayName = "IFrame";
|
|
6061
6091
|
function Tabs({
|
|
6062
6092
|
tabIndex,
|
|
6063
6093
|
items,
|
|
@@ -6079,19 +6109,22 @@ function CodePreview({
|
|
|
6079
6109
|
isRTL,
|
|
6080
6110
|
isDarkMode,
|
|
6081
6111
|
iframe,
|
|
6082
|
-
|
|
6083
|
-
primaryColor,
|
|
6084
|
-
themeCategory,
|
|
6112
|
+
themeValues,
|
|
6085
6113
|
children
|
|
6086
6114
|
}) {
|
|
6087
|
-
const
|
|
6088
|
-
|
|
6115
|
+
const cssVars = React6__default.useMemo(() => {
|
|
6116
|
+
const withCssVarNames = Object.entries(themeValues).map(([key, value]) => {
|
|
6117
|
+
const kebab = key.replace(/(\D+)(\d+)/, "$1-$2");
|
|
6118
|
+
return [`--color-${kebab}`, value];
|
|
6119
|
+
});
|
|
6120
|
+
return Object.fromEntries(withCssVarNames);
|
|
6121
|
+
}, [themeValues]);
|
|
6089
6122
|
return /* @__PURE__ */ jsx(
|
|
6090
6123
|
"div",
|
|
6091
6124
|
{
|
|
6092
6125
|
...isRTL && { dir: "rtl" },
|
|
6093
6126
|
className: "code-preview-wrapper",
|
|
6094
|
-
style:
|
|
6127
|
+
style: cssVars,
|
|
6095
6128
|
children: /* @__PURE__ */ jsx("div", { className: "border-grey-200 dark:border-grey-600 dark:bg-grey-900 flex border-x bg-white bg-gradient-to-r p-0", children: /* @__PURE__ */ jsx(
|
|
6096
6129
|
"div",
|
|
6097
6130
|
{
|
|
@@ -6119,7 +6152,7 @@ function CodePreview({
|
|
|
6119
6152
|
);
|
|
6120
6153
|
}
|
|
6121
6154
|
function EditOnGithubButton({ githubSlug }) {
|
|
6122
|
-
const githubSrcHref = "https://github.com
|
|
6155
|
+
const githubSrcHref = "https://github.com";
|
|
6123
6156
|
const href = `${githubSrcHref}${githubSlug}`;
|
|
6124
6157
|
return /* @__PURE__ */ jsxs(
|
|
6125
6158
|
Button2,
|
|
@@ -6900,10 +6933,10 @@ function DynamicFavicon({ lightModeFavicon, darkModeFavicon }) {
|
|
|
6900
6933
|
}, [lightModeFavicon, darkModeFavicon]);
|
|
6901
6934
|
return null;
|
|
6902
6935
|
}
|
|
6903
|
-
var ExpandableSearchContext =
|
|
6904
|
-
var ExpandableSearch =
|
|
6905
|
-
const [value, setValue] =
|
|
6906
|
-
const formRef =
|
|
6936
|
+
var ExpandableSearchContext = React6.createContext(null);
|
|
6937
|
+
var ExpandableSearch = React6.forwardRef(({ className, onAction, defaultValue = "", ...props }, ref) => {
|
|
6938
|
+
const [value, setValue] = React6.useState(defaultValue);
|
|
6939
|
+
const formRef = React6.useRef(null);
|
|
6907
6940
|
const handleAction = (e) => {
|
|
6908
6941
|
e.preventDefault();
|
|
6909
6942
|
if (onAction) {
|
|
@@ -6921,10 +6954,10 @@ var ExpandableSearch = React5.forwardRef(({ className, onAction, defaultValue =
|
|
|
6921
6954
|
) });
|
|
6922
6955
|
});
|
|
6923
6956
|
ExpandableSearch.displayName = "ExpandableSearch";
|
|
6924
|
-
var ExpandableSearchField =
|
|
6925
|
-
const context =
|
|
6957
|
+
var ExpandableSearchField = React6.forwardRef(({ className, ...props }, ref) => {
|
|
6958
|
+
const context = React6.useContext(ExpandableSearchContext);
|
|
6926
6959
|
if (!context) throw new Error("ExpandableSearchField must be used within ExpandableSearch");
|
|
6927
|
-
const [isFocused, setIsFocused] =
|
|
6960
|
+
const [isFocused, setIsFocused] = React6.useState(false);
|
|
6928
6961
|
const isActive = context.value.length > 0 || isFocused;
|
|
6929
6962
|
return /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
|
|
6930
6963
|
/* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: "expandable-search", children: "Search" }),
|
|
@@ -7121,7 +7154,7 @@ function Toggle({
|
|
|
7121
7154
|
}
|
|
7122
7155
|
);
|
|
7123
7156
|
}
|
|
7124
|
-
var ToggleGroupContext =
|
|
7157
|
+
var ToggleGroupContext = React6.createContext({
|
|
7125
7158
|
size: "default",
|
|
7126
7159
|
variant: "ghost"
|
|
7127
7160
|
});
|
|
@@ -7154,7 +7187,7 @@ function ToggleGroupItem({
|
|
|
7154
7187
|
size,
|
|
7155
7188
|
...props
|
|
7156
7189
|
}) {
|
|
7157
|
-
const context =
|
|
7190
|
+
const context = React6.useContext(ToggleGroupContext);
|
|
7158
7191
|
return /* @__PURE__ */ jsx(
|
|
7159
7192
|
ToggleGroupPrimitive.Item,
|
|
7160
7193
|
{
|
|
@@ -7196,22 +7229,27 @@ function FormatToggle({ format, setFormat }) {
|
|
|
7196
7229
|
function Heading({
|
|
7197
7230
|
className,
|
|
7198
7231
|
trim = "normal",
|
|
7199
|
-
size =
|
|
7232
|
+
size = 1,
|
|
7200
7233
|
level = 1,
|
|
7234
|
+
display = false,
|
|
7201
7235
|
...props
|
|
7202
7236
|
}) {
|
|
7203
7237
|
const Element = `h${level}`;
|
|
7204
|
-
const
|
|
7205
|
-
1: "text-[calc(var(--font-size-1)_*_var(--heading-font-size-adjust))] leading-[var(--
|
|
7206
|
-
2: "text-[calc(var(--font-size-2)_*_var(--heading-font-size-adjust))] leading-[var(--
|
|
7207
|
-
3: "text-[calc(var(--font-size-3)_*_var(--heading-font-size-adjust))] leading-[var(--
|
|
7208
|
-
4: "text-[calc(var(--font-size-4)_*_var(--heading-font-size-adjust))] leading-[var(--
|
|
7209
|
-
5: "text-[calc(var(--font-size-5)_*_var(--heading-font-size-adjust))] leading-[var(--
|
|
7210
|
-
6: "text-[calc(var(--font-size-6)_*_var(--heading-font-size-adjust))] leading-[var(--
|
|
7211
|
-
7: "text-[calc(var(--font-size-7)_*_var(--heading-font-size-adjust))] leading-[var(--heading-line-height-7)] tracking-[calc(var(--letter-spacing-7)_+_var(--heading-letter-spacing))]",
|
|
7212
|
-
8: "text-[calc(var(--font-size-8)_*_var(--heading-font-size-adjust))] leading-[var(--heading-line-height-8)] tracking-[calc(var(--letter-spacing-8)_+_var(--heading-letter-spacing))]",
|
|
7213
|
-
9: "text-[calc(var(--font-size-9)_*_var(--heading-font-size-adjust))] leading-[var(--heading-line-height-9)] tracking-[calc(var(--letter-spacing-9)_+_var(--heading-letter-spacing))]"
|
|
7238
|
+
const headingSizeClasses = {
|
|
7239
|
+
1: "text-[calc(var(--heading-font-size-1)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-52)] tracking-[calc(var(--heading-letter-spacing-2)_+_var(--heading-letter-spacing))]",
|
|
7240
|
+
2: "text-[calc(var(--heading-font-size-2)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-44)] tracking-[calc(var(--heading-letter-spacing-2)_+_var(--heading-letter-spacing))]",
|
|
7241
|
+
3: "text-[calc(var(--heading-font-size-3)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-40)] tracking-[calc(var(--heading-letter-spacing-2)_+_var(--heading-letter-spacing))]",
|
|
7242
|
+
4: "text-[calc(var(--heading-font-size-4)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-36)] tracking-[calc(var(--heading-letter-spacing-1)_+_var(--heading-letter-spacing))]",
|
|
7243
|
+
5: "text-[calc(var(--heading-font-size-5)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-32)] tracking-[calc(var(--heading-letter-spacing-1)_+_var(--heading-letter-spacing))]",
|
|
7244
|
+
6: "text-[calc(var(--heading-font-size-6)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-28)] tracking-[calc(var(--letter-spacing-0)_+_var(--heading-letter-spacing))]"
|
|
7214
7245
|
};
|
|
7246
|
+
const displaySizeClasses = {
|
|
7247
|
+
1: "text-[calc(var(--display-font-size-1)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-96)] tracking-[calc(var(--heading-letter-spacing-3)_+_var(--heading-letter-spacing))]",
|
|
7248
|
+
2: "text-[calc(var(--display-font-size-2)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-60)] tracking-[calc(var(--heading-letter-spacing-2)_+_var(--heading-letter-spacing))]",
|
|
7249
|
+
3: "text-[calc(var(--display-font-size-3)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-52)] tracking-[calc(var(--heading-letter-spacing-2)_+_var(--heading-letter-spacing))]",
|
|
7250
|
+
4: "text-[calc(var(--display-font-size-4)_*_var(--heading-font-size-adjust))] leading-[var(--line-height-44)] tracking-[calc(var(--heading-letter-spacing-2)_+_var(--heading-letter-spacing))]"
|
|
7251
|
+
};
|
|
7252
|
+
const sizeClass = display ? displaySizeClasses[size] : headingSizeClasses[size];
|
|
7215
7253
|
const trimClasses = {
|
|
7216
7254
|
normal: ["before:content-none after:content-none"],
|
|
7217
7255
|
start: [
|
|
@@ -7239,7 +7277,7 @@ function Heading({
|
|
|
7239
7277
|
"leading-[var(--line-height)] font-[var(--heading-font-family)] font-bold",
|
|
7240
7278
|
"[--leading-trim-end:var(--heading-leading-trim-end)] [--leading-trim-start:var(--heading-leading-trim-start)]",
|
|
7241
7279
|
"text-primary-800 dark:text-white",
|
|
7242
|
-
|
|
7280
|
+
sizeClass
|
|
7243
7281
|
)
|
|
7244
7282
|
}
|
|
7245
7283
|
);
|
|
@@ -7247,7 +7285,7 @@ function Heading({
|
|
|
7247
7285
|
|
|
7248
7286
|
// package.json
|
|
7249
7287
|
var package_default = {
|
|
7250
|
-
version: "1.
|
|
7288
|
+
version: "1.21.0"};
|
|
7251
7289
|
function Logo(props) {
|
|
7252
7290
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7253
7291
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "NSW Government" }),
|
|
@@ -7313,9 +7351,9 @@ function ThemeSwitcher() {
|
|
|
7313
7351
|
);
|
|
7314
7352
|
}
|
|
7315
7353
|
function SiteSearch({ navigation }) {
|
|
7316
|
-
const [open, setOpen] =
|
|
7354
|
+
const [open, setOpen] = React6.useState(false);
|
|
7317
7355
|
const router = useRouter();
|
|
7318
|
-
|
|
7356
|
+
React6.useEffect(() => {
|
|
7319
7357
|
const down = (e) => {
|
|
7320
7358
|
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
7321
7359
|
e.preventDefault();
|
|
@@ -7325,7 +7363,7 @@ function SiteSearch({ navigation }) {
|
|
|
7325
7363
|
document.addEventListener("keydown", down);
|
|
7326
7364
|
return () => document.removeEventListener("keydown", down);
|
|
7327
7365
|
}, []);
|
|
7328
|
-
const runCommand =
|
|
7366
|
+
const runCommand = React6.useCallback((command) => {
|
|
7329
7367
|
setOpen(false);
|
|
7330
7368
|
command();
|
|
7331
7369
|
}, []);
|
|
@@ -8259,7 +8297,7 @@ function Slider({
|
|
|
8259
8297
|
max = 100,
|
|
8260
8298
|
...props
|
|
8261
8299
|
}) {
|
|
8262
|
-
const _values =
|
|
8300
|
+
const _values = React6.useMemo(
|
|
8263
8301
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
8264
8302
|
[value, defaultValue, min, max]
|
|
8265
8303
|
);
|
|
@@ -8611,18 +8649,20 @@ function TabsContent({ className, ...props }) {
|
|
|
8611
8649
|
}
|
|
8612
8650
|
);
|
|
8613
8651
|
}
|
|
8614
|
-
function Text({ className, trim = "normal", size =
|
|
8615
|
-
const
|
|
8616
|
-
1: "text-[
|
|
8617
|
-
2: "text-[
|
|
8618
|
-
3: "text-[
|
|
8619
|
-
4: "text-[
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8652
|
+
function Text({ className, trim = "normal", size = 2, label = false, ...props }) {
|
|
8653
|
+
const textSizeClasses = {
|
|
8654
|
+
1: "text-[length:var(--font-size-1)] leading-[var(--line-height-28)] tracking-[var(--letter-spacing-0)]",
|
|
8655
|
+
2: "text-[length:var(--font-size-2)] leading-[var(--line-height-24)] tracking-[var(--letter-spacing-0)]",
|
|
8656
|
+
3: "text-[length:var(--font-size-3)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]",
|
|
8657
|
+
4: "text-[length:var(--font-size-4)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]"
|
|
8658
|
+
};
|
|
8659
|
+
const labelSizeClasses = {
|
|
8660
|
+
1: "text-[length:var(--font-size-1)] leading-[var(--line-height-24)] tracking-[var(--letter-spacing-0)]",
|
|
8661
|
+
2: "text-[length:var(--font-size-2)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]",
|
|
8662
|
+
3: "text-[length:var(--font-size-3)] leading-[var(--line-height-16)] tracking-[var(--letter-spacing-0)]",
|
|
8663
|
+
4: "text-[length:var(--font-size-4)] leading-[var(--line-height-16)] tracking-[var(--letter-spacing-0)]"
|
|
8625
8664
|
};
|
|
8665
|
+
const sizeClass = label ? labelSizeClasses[size] : textSizeClasses[size];
|
|
8626
8666
|
const trimClasses = {
|
|
8627
8667
|
normal: ["before:content-none after:content-none"],
|
|
8628
8668
|
start: [
|
|
@@ -8644,12 +8684,7 @@ function Text({ className, trim = "normal", size = 8, ...props }) {
|
|
|
8644
8684
|
{
|
|
8645
8685
|
"data-slot": "text",
|
|
8646
8686
|
...props,
|
|
8647
|
-
className: clsx11(
|
|
8648
|
-
className,
|
|
8649
|
-
trimClasses[trim],
|
|
8650
|
-
"text-grey-800 dark:text-grey-400 text-base/6 sm:text-sm/6",
|
|
8651
|
-
sizeClasses[size]
|
|
8652
|
-
)
|
|
8687
|
+
className: clsx11(className, trimClasses[trim], "text-grey-800 dark:text-grey-400", sizeClass)
|
|
8653
8688
|
}
|
|
8654
8689
|
);
|
|
8655
8690
|
}
|
|
@@ -8831,18 +8866,15 @@ function ThemeColorPalette() {
|
|
|
8831
8866
|
] })
|
|
8832
8867
|
] })
|
|
8833
8868
|
] }),
|
|
8834
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-12", children: currentColorPalette.map((theme2) =>
|
|
8835
|
-
|
|
8836
|
-
/* @__PURE__ */
|
|
8837
|
-
|
|
8838
|
-
{
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
/* @__PURE__ */ jsx(ColourScale, { colorsToUse: theme2.colors }, theme2.name),
|
|
8844
|
-
/* @__PURE__ */ jsx(ColorSwatches, { theme: theme2.colors, format, viewMode })
|
|
8845
|
-
] }, theme2.name)) })
|
|
8869
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-12", children: currentColorPalette.map((theme2) => {
|
|
8870
|
+
const baseKey = theme2.name === "Primary" ? primaryColor : theme2.name === "Accent" ? accentColor : "grey";
|
|
8871
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
8872
|
+
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold", children: theme2.name }),
|
|
8873
|
+
/* @__PURE__ */ jsx(BaseColorSwatches, { baseColors: baseColors[themeCategory][baseKey], format }),
|
|
8874
|
+
/* @__PURE__ */ jsx(ColourScale, { colorsToUse: theme2.colors }),
|
|
8875
|
+
/* @__PURE__ */ jsx(ColorSwatches, { theme: theme2.colors, format, viewMode })
|
|
8876
|
+
] }, theme2.name);
|
|
8877
|
+
}) })
|
|
8846
8878
|
] });
|
|
8847
8879
|
}
|
|
8848
8880
|
function ThemeProvider({ children, ...props }) {
|
|
@@ -8938,7 +8970,8 @@ var languages = [
|
|
|
8938
8970
|
"jsx",
|
|
8939
8971
|
"ts",
|
|
8940
8972
|
"tsx",
|
|
8941
|
-
"typescript"
|
|
8973
|
+
"typescript",
|
|
8974
|
+
"html"
|
|
8942
8975
|
];
|
|
8943
8976
|
|
|
8944
8977
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BaseColorSwatches, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Code, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorSwatches, ColourScale, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ExpandableSearch, ExpandableSearchField, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, Icons, Input, Label3 as Label, Link, Logo, Masthead, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, RadioGroup2 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarLink, SidebarNavigation, SiteSearch, Skeleton, Slider, Social, Spinner, Strong, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TouchTarget, ViewToggle, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, cn, colorDataArray, colorThemes, colors, createColorArray, createColorData, darkenColor, domToSimple, generateColorThemes, getColorValue, getHeadings, getNodeText, getSurroundingColors, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, renderColorOutput, renderColorOutputToDTFM, semantic, shades, themeIndices, themeTokens, toggleVariants, truncate, useToc };
|