@workos-inc/widgets 1.10.2-next.1776269843020 → 1.10.2-next.1776358760696

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/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## 1.10.2-next.1776269843020
3
+ ## 1.10.2-next.1776358760696
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - [#209](https://github.com/workos/widgets/pull/209) [`3cab61c`](https://github.com/workos/widgets/commit/3cab61ce4bc88b6dedb7ecba4ce2b42dc8301fbc) Thanks [@chaance](https://github.com/chaance)! - Internal refactoring.
7
+ - [#222](https://github.com/workos/widgets/pull/222) [`c6d4ca0`](https://github.com/workos/widgets/commit/c6d4ca0ef5a5d4d11e83baee6adc2e5b75203ef9) Thanks [@chaance](https://github.com/chaance)! - Fix semantic markup for data list elements in the User Profile Widget
8
8
 
9
9
  ## 1.10.1
10
10
 
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var api_key_details_card_exports = {};
20
30
  __export(api_key_details_card_exports, {
@@ -23,15 +33,16 @@ __export(api_key_details_card_exports, {
23
33
  module.exports = __toCommonJS(api_key_details_card_exports);
24
34
  var import_jsx_runtime = require("react/jsx-runtime");
25
35
  var import_themes = require("@radix-ui/themes");
36
+ var DataList = __toESM(require("../data-list.js"), 1);
26
37
  var import_relative_time = require("./relative-time.js");
27
38
  var import_translation = require("../i18n/translation.js");
28
39
  function ApiKeyDetailsCard({
29
40
  apiKey,
30
41
  ...cardProps
31
42
  }) {
32
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Card, { size: "2", ...cardProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.DataList.Root, { children: [
33
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.DataList.Item, { children: [
34
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.DataList.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Card, { size: "2", ...cardProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DataList.Root, { children: [
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DataList.Item, { children: [
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataList.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
46
  import_translation.Translation,
36
47
  {
37
48
  defaultMessage: "Name",
@@ -39,10 +50,10 @@ function ApiKeyDetailsCard({
39
50
  description: "Label for API key name field"
40
51
  }
41
52
  ) }),
42
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.DataList.Value, { children: apiKey.name })
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataList.Value, { children: apiKey.name })
43
54
  ] }),
44
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.DataList.Item, { children: [
45
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.DataList.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DataList.Item, { children: [
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataList.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
57
  import_translation.Translation,
47
58
  {
48
59
  defaultMessage: "Value",
@@ -50,10 +61,10 @@ function ApiKeyDetailsCard({
50
61
  description: "Label for API key value field"
51
62
  }
52
63
  ) }),
53
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.DataList.Value, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Code, { color: "gray", children: apiKey.obfuscatedValue }) })
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataList.Value, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Code, { color: "gray", children: apiKey.obfuscatedValue }) })
54
65
  ] }),
55
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.DataList.Item, { children: [
56
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.DataList.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DataList.Item, { children: [
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataList.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
68
  import_translation.Translation,
58
69
  {
59
70
  defaultMessage: "Last used",
@@ -62,7 +73,7 @@ function ApiKeyDetailsCard({
62
73
  }
63
74
  ) }),
64
75
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
- import_themes.DataList.Value,
76
+ DataList.Value,
66
77
  {
67
78
  style: apiKey.lastUsedAt ? void 0 : { color: "var(--gray-10)" },
68
79
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/api-keys/api-key-details-card.tsx"],"sourcesContent":["import { DataList, Card, Code, CardProps } from \"@radix-ui/themes\";\nimport { RelativeTime } from \"./relative-time.js\";\nimport { ListOrganizationApiKeysResponseData } from \"../../api/endpoint.js\";\nimport { Translation } from \"../i18n/translation.js\";\n\nexport function ApiKeyDetailsCard({\n apiKey,\n ...cardProps\n}: { apiKey: ListOrganizationApiKeysResponseData } & CardProps) {\n return (\n <Card size=\"2\" {...cardProps}>\n <DataList.Root>\n <DataList.Item>\n <DataList.Label>\n <Translation\n defaultMessage=\"Name\"\n id=\"tuCHkH\"\n description=\"Label for API key name field\"\n />\n </DataList.Label>\n <DataList.Value>{apiKey.name}</DataList.Value>\n </DataList.Item>\n <DataList.Item>\n <DataList.Label>\n <Translation\n defaultMessage=\"Value\"\n id=\"HnuClZ\"\n description=\"Label for API key value field\"\n />\n </DataList.Label>\n <DataList.Value>\n <Code color=\"gray\">{apiKey.obfuscatedValue}</Code>\n </DataList.Value>\n </DataList.Item>\n <DataList.Item>\n <DataList.Label>\n <Translation\n defaultMessage=\"Last used\"\n id=\"elg/zm\"\n description=\"Label for API key last used timestamp\"\n />\n </DataList.Label>\n <DataList.Value\n style={apiKey.lastUsedAt ? undefined : { color: \"var(--gray-10)\" }}\n >\n <RelativeTime\n date={apiKey.lastUsedAt ? new Date(apiKey.lastUsedAt) : undefined}\n />\n </DataList.Value>\n </DataList.Item>\n </DataList.Root>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYQ;AAZR,oBAAgD;AAChD,2BAA6B;AAE7B,yBAA4B;AAErB,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA,GAAG;AACL,GAAgE;AAC9D,SACE,4CAAC,sBAAK,MAAK,KAAK,GAAG,WACjB,uDAAC,uBAAS,MAAT,EACC;AAAA,iDAAC,uBAAS,MAAT,EACC;AAAA,kDAAC,uBAAS,OAAT,EACC;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA,4CAAC,uBAAS,OAAT,EAAgB,iBAAO,MAAK;AAAA,OAC/B;AAAA,IACA,6CAAC,uBAAS,MAAT,EACC;AAAA,kDAAC,uBAAS,OAAT,EACC;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA,4CAAC,uBAAS,OAAT,EACC,sDAAC,sBAAK,OAAM,QAAQ,iBAAO,iBAAgB,GAC7C;AAAA,OACF;AAAA,IACA,6CAAC,uBAAS,MAAT,EACC;AAAA,kDAAC,uBAAS,OAAT,EACC;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA;AAAA,QAAC,uBAAS;AAAA,QAAT;AAAA,UACC,OAAO,OAAO,aAAa,SAAY,EAAE,OAAO,iBAAiB;AAAA,UAEjE;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,OAAO,aAAa,IAAI,KAAK,OAAO,UAAU,IAAI;AAAA;AAAA,UAC1D;AAAA;AAAA,MACF;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/api-keys/api-key-details-card.tsx"],"sourcesContent":["import { Card, Code, CardProps } from \"@radix-ui/themes\";\nimport * as DataList from \"../data-list.js\";\nimport { RelativeTime } from \"./relative-time.js\";\nimport { ListOrganizationApiKeysResponseData } from \"../../api/endpoint.js\";\nimport { Translation } from \"../i18n/translation.js\";\n\nexport function ApiKeyDetailsCard({\n apiKey,\n ...cardProps\n}: { apiKey: ListOrganizationApiKeysResponseData } & CardProps) {\n return (\n <Card size=\"2\" {...cardProps}>\n <DataList.Root>\n <DataList.Item>\n <DataList.Label>\n <Translation\n defaultMessage=\"Name\"\n id=\"tuCHkH\"\n description=\"Label for API key name field\"\n />\n </DataList.Label>\n <DataList.Value>{apiKey.name}</DataList.Value>\n </DataList.Item>\n <DataList.Item>\n <DataList.Label>\n <Translation\n defaultMessage=\"Value\"\n id=\"HnuClZ\"\n description=\"Label for API key value field\"\n />\n </DataList.Label>\n <DataList.Value>\n <Code color=\"gray\">{apiKey.obfuscatedValue}</Code>\n </DataList.Value>\n </DataList.Item>\n <DataList.Item>\n <DataList.Label>\n <Translation\n defaultMessage=\"Last used\"\n id=\"elg/zm\"\n description=\"Label for API key last used timestamp\"\n />\n </DataList.Label>\n <DataList.Value\n style={apiKey.lastUsedAt ? undefined : { color: \"var(--gray-10)\" }}\n >\n <RelativeTime\n date={apiKey.lastUsedAt ? new Date(apiKey.lastUsedAt) : undefined}\n />\n </DataList.Value>\n </DataList.Item>\n </DataList.Root>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaQ;AAbR,oBAAsC;AACtC,eAA0B;AAC1B,2BAA6B;AAE7B,yBAA4B;AAErB,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA,GAAG;AACL,GAAgE;AAC9D,SACE,4CAAC,sBAAK,MAAK,KAAK,GAAG,WACjB,uDAAC,SAAS,MAAT,EACC;AAAA,iDAAC,SAAS,MAAT,EACC;AAAA,kDAAC,SAAS,OAAT,EACC;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA,4CAAC,SAAS,OAAT,EAAgB,iBAAO,MAAK;AAAA,OAC/B;AAAA,IACA,6CAAC,SAAS,MAAT,EACC;AAAA,kDAAC,SAAS,OAAT,EACC;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA,4CAAC,SAAS,OAAT,EACC,sDAAC,sBAAK,OAAM,QAAQ,iBAAO,iBAAgB,GAC7C;AAAA,OACF;AAAA,IACA,6CAAC,SAAS,MAAT,EACC;AAAA,kDAAC,SAAS,OAAT,EACC;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA;AAAA,QAAC,SAAS;AAAA,QAAT;AAAA,UACC,OAAO,OAAO,aAAa,SAAY,EAAE,OAAO,iBAAiB;AAAA,UAEjE;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,OAAO,aAAa,IAAI,KAAK,OAAO,UAAU,IAAI;AAAA;AAAA,UAC1D;AAAA;AAAA,MACF;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var data_list_exports = {};
30
+ __export(data_list_exports, {
31
+ Item: () => DataListItem,
32
+ Label: () => DataListLabel,
33
+ Root: () => DataListRoot,
34
+ Value: () => DataListValue
35
+ });
36
+ module.exports = __toCommonJS(data_list_exports);
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var import_clsx = __toESM(require("clsx"), 1);
39
+ var React = __toESM(require("react"), 1);
40
+ var import_themes = require("@radix-ui/themes");
41
+ var import_radix_ui = require("radix-ui");
42
+ var import_helpers = require("@radix-ui/themes/helpers");
43
+ var import_data_list_props = require("./data-list.props.js");
44
+ const DataListRoot = React.forwardRef(
45
+ (props, forwardedRef) => {
46
+ const {
47
+ children,
48
+ className,
49
+ asChild,
50
+ as: Tag = "dl",
51
+ ...dataListProps
52
+ } = (0, import_helpers.extractProps)(props, import_data_list_props.dataListRootPropDefs);
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ import_radix_ui.Slot.Root,
55
+ {
56
+ ...dataListProps,
57
+ ref: forwardedRef,
58
+ className: (0, import_clsx.default)("rt-DataListRoot", className),
59
+ children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { children })
60
+ }
61
+ ) });
62
+ }
63
+ );
64
+ DataListRoot.displayName = "DataList.Root";
65
+ const DataListItem = React.forwardRef(
66
+ (props, forwardedRef) => {
67
+ const { children, className, asChild, ...itemProps } = (0, import_helpers.extractProps)(
68
+ props,
69
+ import_data_list_props.dataListItemPropDefs
70
+ );
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ import_radix_ui.Slot.Root,
73
+ {
74
+ ...itemProps,
75
+ ref: forwardedRef,
76
+ className: (0, import_clsx.default)("rt-DataListItem", className),
77
+ children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children })
78
+ }
79
+ );
80
+ }
81
+ );
82
+ DataListItem.displayName = "DataList.Item";
83
+ const DataListLabel = React.forwardRef((props, forwardedRef) => {
84
+ const {
85
+ asChild,
86
+ as: Tag = "dt",
87
+ children,
88
+ className,
89
+ color,
90
+ ...labelProps
91
+ } = (0, import_helpers.extractProps)(props, import_data_list_props.dataListLabelPropDefs);
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ import_radix_ui.Slot.Root,
94
+ {
95
+ ...labelProps,
96
+ "data-accent-color": color,
97
+ ref: forwardedRef,
98
+ className: (0, import_clsx.default)("rt-DataListLabel", className),
99
+ children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { children })
100
+ }
101
+ );
102
+ });
103
+ DataListLabel.displayName = "DataList.Label";
104
+ const DataListValue = React.forwardRef((props, forwardedRef) => {
105
+ const {
106
+ children,
107
+ className,
108
+ asChild,
109
+ as: Tag = "dd",
110
+ ...valueProps
111
+ } = (0, import_helpers.extractProps)(props, import_data_list_props.dataListValuePropDefs);
112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
+ import_radix_ui.Slot.Root,
114
+ {
115
+ ...valueProps,
116
+ ref: forwardedRef,
117
+ className: (0, import_clsx.default)(className, "rt-DataListValue"),
118
+ children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { children })
119
+ }
120
+ );
121
+ });
122
+ DataListValue.displayName = "DataList.Value";
123
+ // Annotate the CommonJS export names for ESM import in node:
124
+ 0 && (module.exports = {
125
+ Item,
126
+ Label,
127
+ Root,
128
+ Value
129
+ });
130
+ //# sourceMappingURL=data-list.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/data-list.tsx"],"sourcesContent":["import classNames from \"clsx\";\nimport * as React from \"react\";\nimport { Text } from \"@radix-ui/themes\";\nimport { Slot } from \"radix-ui\";\nimport { extractProps } from \"@radix-ui/themes/helpers\";\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n} from \"@radix-ui/themes/helpers\";\nimport type { GetPropDefTypes, MarginProps } from \"@radix-ui/themes/props\";\nimport {\n dataListItemPropDefs,\n dataListLabelPropDefs,\n dataListRootPropDefs,\n dataListValuePropDefs,\n} from \"./data-list.props.js\";\n\ntype DataListRootElement = HTMLDListElement;\ntype DataListRootOwnProps = GetPropDefTypes<typeof dataListRootPropDefs>;\ninterface CommonDataListRootProps extends MarginProps, DataListRootOwnProps {}\ntype DataListRootDivProps = { as?: \"div\" } & ComponentPropsWithout<\n \"div\",\n RemovedProps\n>;\ntype DataListRootDlProps = { as?: \"dl\" } & ComponentPropsWithout<\n \"dl\",\n RemovedProps\n>;\ntype DataListRootProps = CommonDataListRootProps &\n (DataListRootDivProps | DataListRootDlProps);\n\nconst DataListRoot = React.forwardRef<DataListRootElement, DataListRootProps>(\n (props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = \"dl\",\n ...dataListProps\n } = extractProps(props, dataListRootPropDefs);\n return (\n <Text asChild>\n <Slot.Root\n {...dataListProps}\n ref={forwardedRef}\n className={classNames(\"rt-DataListRoot\", className)}\n >\n {asChild ? children : <Tag>{children}</Tag>}\n </Slot.Root>\n </Text>\n );\n },\n);\nDataListRoot.displayName = \"DataList.Root\";\n\ntype DataListItemElement = HTMLDivElement;\ntype DataListItemOwnProps = GetPropDefTypes<typeof dataListItemPropDefs>;\ninterface DataListItemProps\n extends ComponentPropsWithout<\"div\", RemovedProps>, DataListItemOwnProps {}\nconst DataListItem = React.forwardRef<DataListItemElement, DataListItemProps>(\n (props, forwardedRef) => {\n const { children, className, asChild, ...itemProps } = extractProps(\n props,\n dataListItemPropDefs,\n );\n return (\n <Slot.Root\n {...itemProps}\n ref={forwardedRef}\n className={classNames(\"rt-DataListItem\", className)}\n >\n {asChild ? children : <div>{children}</div>}\n </Slot.Root>\n );\n },\n);\nDataListItem.displayName = \"DataList.Item\";\n\ntype DataListLabelElement = React.ComponentRef<\"dt\">;\ntype DataListLabelOwnProps = GetPropDefTypes<typeof dataListLabelPropDefs>;\ninterface CommonDataListLabelProps extends MarginProps, DataListLabelOwnProps {}\ntype DataListLabelDtProps = { as?: \"dt\" } & ComponentPropsWithout<\n \"dt\",\n RemovedProps\n>;\ntype DataListLabelDivProps = { as?: \"div\" } & ComponentPropsWithout<\n \"div\",\n RemovedProps\n>;\ntype DataListLabelProps = CommonDataListLabelProps &\n (DataListLabelDtProps | DataListLabelDivProps);\n\nconst DataListLabel = React.forwardRef<\n DataListLabelElement,\n DataListLabelProps\n>((props, forwardedRef) => {\n const {\n asChild,\n as: Tag = \"dt\",\n children,\n className,\n color,\n ...labelProps\n } = extractProps(props, dataListLabelPropDefs);\n return (\n <Slot.Root\n {...labelProps}\n data-accent-color={color}\n ref={forwardedRef}\n className={classNames(\"rt-DataListLabel\", className)}\n >\n {asChild ? children : <Tag>{children}</Tag>}\n </Slot.Root>\n );\n});\nDataListLabel.displayName = \"DataList.Label\";\n\ntype DataListValueElement = React.ComponentRef<\"dd\">;\ntype DataListValueOwnProps = GetPropDefTypes<typeof dataListValuePropDefs>;\ninterface CommonDataListValueProps extends MarginProps, DataListValueOwnProps {}\ntype DataListValueDdProps = { as?: \"dd\" } & ComponentPropsWithout<\n \"dd\",\n RemovedProps\n>;\ntype DataListValueDivProps = { as?: \"div\" } & ComponentPropsWithout<\n \"div\",\n RemovedProps\n>;\ntype DataListValueProps = CommonDataListValueProps &\n (DataListValueDdProps | DataListValueDivProps);\nconst DataListValue = React.forwardRef<\n DataListValueElement,\n DataListValueProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = \"dd\",\n ...valueProps\n } = extractProps(props, dataListValuePropDefs);\n return (\n <Slot.Root\n {...valueProps}\n ref={forwardedRef}\n className={classNames(className, \"rt-DataListValue\")}\n >\n {asChild ? children : <Tag>{children}</Tag>}\n </Slot.Root>\n );\n});\nDataListValue.displayName = \"DataList.Value\";\n\nexport {\n DataListRoot as Root,\n DataListItem as Item,\n DataListLabel as Label,\n DataListValue as Value,\n};\nexport type {\n DataListRootElement as RootElement,\n DataListRootProps as RootProps,\n DataListItemElement as ItemElement,\n DataListItemProps as ItemProps,\n DataListLabelElement as LabelElement,\n DataListLabelProps as LabelProps,\n DataListValueElement as ValueElement,\n DataListValueProps as ValueProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CgC;AA/ChC,kBAAuB;AACvB,YAAuB;AACvB,oBAAqB;AACrB,sBAAqB;AACrB,qBAA6B;AAM7B,6BAKO;AAgBP,MAAM,eAAe,MAAM;AAAA,EACzB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,MAAM;AAAA,MACV,GAAG;AAAA,IACL,QAAI,6BAAa,OAAO,2CAAoB;AAC5C,WACE,4CAAC,sBAAK,SAAO,MACX;AAAA,MAAC,qBAAK;AAAA,MAAL;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,eAAW,YAAAA,SAAW,mBAAmB,SAAS;AAAA,QAEjD,oBAAU,WAAW,4CAAC,OAAK,UAAS;AAAA;AAAA,IACvC,GACF;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAM3B,MAAM,eAAe,MAAM;AAAA,EACzB,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,UAAU,WAAW,SAAS,GAAG,UAAU,QAAI;AAAA,MACrD;AAAA,MACA;AAAA,IACF;AACA,WACE;AAAA,MAAC,qBAAK;AAAA,MAAL;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,eAAW,YAAAA,SAAW,mBAAmB,SAAS;AAAA,QAEjD,oBAAU,WAAW,4CAAC,SAAK,UAAS;AAAA;AAAA,IACvC;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;AAgB3B,MAAM,gBAAgB,MAAM,WAG1B,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA,IAAI,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,QAAI,6BAAa,OAAO,4CAAqB;AAC7C,SACE;AAAA,IAAC,qBAAK;AAAA,IAAL;AAAA,MACE,GAAG;AAAA,MACJ,qBAAmB;AAAA,MACnB,KAAK;AAAA,MACL,eAAW,YAAAA,SAAW,oBAAoB,SAAS;AAAA,MAElD,oBAAU,WAAW,4CAAC,OAAK,UAAS;AAAA;AAAA,EACvC;AAEJ,CAAC;AACD,cAAc,cAAc;AAe5B,MAAM,gBAAgB,MAAM,WAG1B,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,IAAI,MAAM;AAAA,IACV,GAAG;AAAA,EACL,QAAI,6BAAa,OAAO,4CAAqB;AAC7C,SACE;AAAA,IAAC,qBAAK;AAAA,IAAL;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,eAAW,YAAAA,SAAW,WAAW,kBAAkB;AAAA,MAElD,oBAAU,WAAW,4CAAC,OAAK,UAAS;AAAA;AAAA,EACvC;AAEJ,CAAC;AACD,cAAc,cAAc;","names":["classNames"]}
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import { ComponentPropsWithout, RemovedProps } from '@radix-ui/themes/helpers';
3
+ import { MarginProps, GetPropDefTypes } from '@radix-ui/themes/props';
4
+ import { dataListRootPropDefs, dataListItemPropDefs, dataListLabelPropDefs, dataListValuePropDefs } from './data-list.props.cjs';
5
+
6
+ type DataListRootElement = HTMLDListElement;
7
+ type DataListRootOwnProps = GetPropDefTypes<typeof dataListRootPropDefs>;
8
+ interface CommonDataListRootProps extends MarginProps, DataListRootOwnProps {
9
+ }
10
+ type DataListRootDivProps = {
11
+ as?: "div";
12
+ } & ComponentPropsWithout<"div", RemovedProps>;
13
+ type DataListRootDlProps = {
14
+ as?: "dl";
15
+ } & ComponentPropsWithout<"dl", RemovedProps>;
16
+ type DataListRootProps = CommonDataListRootProps & (DataListRootDivProps | DataListRootDlProps);
17
+ declare const DataListRoot: React.ForwardRefExoticComponent<DataListRootProps & React.RefAttributes<HTMLDListElement>>;
18
+ type DataListItemElement = HTMLDivElement;
19
+ type DataListItemOwnProps = GetPropDefTypes<typeof dataListItemPropDefs>;
20
+ interface DataListItemProps extends ComponentPropsWithout<"div", RemovedProps>, DataListItemOwnProps {
21
+ }
22
+ declare const DataListItem: React.ForwardRefExoticComponent<DataListItemProps & React.RefAttributes<HTMLDivElement>>;
23
+ type DataListLabelElement = React.ComponentRef<"dt">;
24
+ type DataListLabelOwnProps = GetPropDefTypes<typeof dataListLabelPropDefs>;
25
+ interface CommonDataListLabelProps extends MarginProps, DataListLabelOwnProps {
26
+ }
27
+ type DataListLabelDtProps = {
28
+ as?: "dt";
29
+ } & ComponentPropsWithout<"dt", RemovedProps>;
30
+ type DataListLabelDivProps = {
31
+ as?: "div";
32
+ } & ComponentPropsWithout<"div", RemovedProps>;
33
+ type DataListLabelProps = CommonDataListLabelProps & (DataListLabelDtProps | DataListLabelDivProps);
34
+ declare const DataListLabel: React.ForwardRefExoticComponent<DataListLabelProps & React.RefAttributes<HTMLElement>>;
35
+ type DataListValueElement = React.ComponentRef<"dd">;
36
+ type DataListValueOwnProps = GetPropDefTypes<typeof dataListValuePropDefs>;
37
+ interface CommonDataListValueProps extends MarginProps, DataListValueOwnProps {
38
+ }
39
+ type DataListValueDdProps = {
40
+ as?: "dd";
41
+ } & ComponentPropsWithout<"dd", RemovedProps>;
42
+ type DataListValueDivProps = {
43
+ as?: "div";
44
+ } & ComponentPropsWithout<"div", RemovedProps>;
45
+ type DataListValueProps = CommonDataListValueProps & (DataListValueDdProps | DataListValueDivProps);
46
+ declare const DataListValue: React.ForwardRefExoticComponent<DataListValueProps & React.RefAttributes<HTMLElement>>;
47
+
48
+ export { DataListItem as Item, type DataListItemElement as ItemElement, type DataListItemProps as ItemProps, DataListLabel as Label, type DataListLabelElement as LabelElement, type DataListLabelProps as LabelProps, DataListRoot as Root, type DataListRootElement as RootElement, type DataListRootProps as RootProps, DataListValue as Value, type DataListValueElement as ValueElement, type DataListValueProps as ValueProps };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var data_list_props_exports = {};
20
+ __export(data_list_props_exports, {
21
+ dataListItemPropDefs: () => dataListItemPropDefs,
22
+ dataListLabelAs: () => dataListLabelAs,
23
+ dataListLabelPropDefs: () => dataListLabelPropDefs,
24
+ dataListRootAs: () => dataListRootAs,
25
+ dataListRootPropDefs: () => dataListRootPropDefs,
26
+ dataListValueAs: () => dataListValueAs,
27
+ dataListValuePropDefs: () => dataListValuePropDefs
28
+ });
29
+ module.exports = __toCommonJS(data_list_props_exports);
30
+ var import_props = require("@radix-ui/themes/props");
31
+ const dataListRootAs = ["dl", "div"];
32
+ const dataListRootPropDefs = {
33
+ ...import_props.dataListRootPropDefs,
34
+ as: { type: "enum", values: dataListRootAs, default: "dl" },
35
+ ...import_props.asChildPropDef
36
+ };
37
+ const dataListItemPropDefs = {
38
+ ...import_props.dataListItemPropDefs,
39
+ ...import_props.asChildPropDef
40
+ };
41
+ const dataListLabelAs = ["dt", "div"];
42
+ const dataListLabelPropDefs = {
43
+ ...import_props.dataListLabelPropDefs,
44
+ as: { type: "enum", values: dataListLabelAs, default: "dt" },
45
+ ...import_props.asChildPropDef
46
+ };
47
+ const dataListValueAs = ["dd", "div"];
48
+ const dataListValuePropDefs = {
49
+ as: { type: "enum", values: dataListValueAs, default: "dd" },
50
+ ...import_props.asChildPropDef
51
+ };
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ dataListItemPropDefs,
55
+ dataListLabelAs,
56
+ dataListLabelPropDefs,
57
+ dataListRootAs,
58
+ dataListRootPropDefs,
59
+ dataListValueAs,
60
+ dataListValuePropDefs
61
+ });
62
+ //# sourceMappingURL=data-list.props.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/data-list.props.tsx"],"sourcesContent":["import {\n asChildPropDef,\n dataListRootPropDefs as themesDataListRootPropDefs,\n dataListItemPropDefs as themesDataListItemPropDefs,\n dataListLabelPropDefs as themesDataListLabelPropDefs,\n} from \"@radix-ui/themes/props\";\nimport type { PropDef } from \"@radix-ui/themes/props\";\n\nexport const dataListRootAs = [\"dl\", \"div\"] as const;\nexport const dataListRootPropDefs = {\n ...themesDataListRootPropDefs,\n as: { type: \"enum\", values: dataListRootAs, default: \"dl\" },\n ...asChildPropDef,\n} satisfies typeof themesDataListRootPropDefs & {\n as: PropDef<(typeof dataListRootAs)[number]>;\n};\n\nexport const dataListItemPropDefs = {\n ...themesDataListItemPropDefs,\n ...asChildPropDef,\n} satisfies typeof themesDataListItemPropDefs;\n\nexport const dataListLabelAs = [\"dt\", \"div\"] as const;\nexport const dataListLabelPropDefs = {\n ...themesDataListLabelPropDefs,\n as: { type: \"enum\", values: dataListLabelAs, default: \"dt\" },\n ...asChildPropDef,\n} satisfies typeof themesDataListLabelPropDefs & {\n as: PropDef<(typeof dataListLabelAs)[number]>;\n};\n\nexport const dataListValueAs = [\"dd\", \"div\"] as const;\nexport const dataListValuePropDefs = {\n as: { type: \"enum\", values: dataListValueAs, default: \"dd\" },\n ...asChildPropDef,\n} satisfies {\n as: PropDef<(typeof dataListValueAs)[number]>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKO;AAGA,MAAM,iBAAiB,CAAC,MAAM,KAAK;AACnC,MAAM,uBAAuB;AAAA,EAClC,GAAG,aAAAA;AAAA,EACH,IAAI,EAAE,MAAM,QAAQ,QAAQ,gBAAgB,SAAS,KAAK;AAAA,EAC1D,GAAG;AACL;AAIO,MAAM,uBAAuB;AAAA,EAClC,GAAG,aAAAC;AAAA,EACH,GAAG;AACL;AAEO,MAAM,kBAAkB,CAAC,MAAM,KAAK;AACpC,MAAM,wBAAwB;AAAA,EACnC,GAAG,aAAAC;AAAA,EACH,IAAI,EAAE,MAAM,QAAQ,QAAQ,iBAAiB,SAAS,KAAK;AAAA,EAC3D,GAAG;AACL;AAIO,MAAM,kBAAkB,CAAC,MAAM,KAAK;AACpC,MAAM,wBAAwB;AAAA,EACnC,IAAI,EAAE,MAAM,QAAQ,QAAQ,iBAAiB,SAAS,KAAK;AAAA,EAC3D,GAAG;AACL;","names":["themesDataListRootPropDefs","themesDataListItemPropDefs","themesDataListLabelPropDefs"]}
@@ -0,0 +1,94 @@
1
+ declare const dataListRootAs: readonly ["dl", "div"];
2
+ declare const dataListRootPropDefs: {
3
+ asChild: {
4
+ type: "boolean";
5
+ };
6
+ as: {
7
+ type: "enum";
8
+ values: readonly ["dl", "div"];
9
+ default: "dl";
10
+ };
11
+ orientation: {
12
+ type: "enum";
13
+ className: string;
14
+ values: readonly ["horizontal", "vertical"];
15
+ default: "horizontal";
16
+ responsive: true;
17
+ };
18
+ size: {
19
+ type: "enum";
20
+ className: string;
21
+ values: readonly ["1", "2", "3"];
22
+ default: "2";
23
+ responsive: true;
24
+ };
25
+ trim: {
26
+ className: string;
27
+ type: "enum";
28
+ values: readonly ["normal", "start", "end", "both"];
29
+ responsive: true;
30
+ };
31
+ };
32
+ declare const dataListItemPropDefs: {
33
+ asChild: {
34
+ type: "boolean";
35
+ };
36
+ align: {
37
+ type: "enum";
38
+ className: string;
39
+ values: readonly ["start", "center", "end", "baseline", "stretch"];
40
+ responsive: true;
41
+ };
42
+ };
43
+ declare const dataListLabelAs: readonly ["dt", "div"];
44
+ declare const dataListLabelPropDefs: {
45
+ asChild: {
46
+ type: "boolean";
47
+ };
48
+ as: {
49
+ type: "enum";
50
+ values: readonly ["dt", "div"];
51
+ default: "dt";
52
+ };
53
+ highContrast: {
54
+ type: "boolean";
55
+ className: string;
56
+ default: undefined;
57
+ };
58
+ color: {
59
+ type: "enum";
60
+ values: readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky"];
61
+ default: ("gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky") | undefined;
62
+ };
63
+ width: {
64
+ type: "string";
65
+ className: string;
66
+ customProperties: "--width"[];
67
+ responsive: true;
68
+ };
69
+ minWidth: {
70
+ type: "string";
71
+ className: string;
72
+ customProperties: "--min-width"[];
73
+ responsive: true;
74
+ };
75
+ maxWidth: {
76
+ type: "string";
77
+ className: string;
78
+ customProperties: "--max-width"[];
79
+ responsive: true;
80
+ };
81
+ };
82
+ declare const dataListValueAs: readonly ["dd", "div"];
83
+ declare const dataListValuePropDefs: {
84
+ asChild: {
85
+ type: "boolean";
86
+ };
87
+ as: {
88
+ type: "enum";
89
+ values: readonly ["dd", "div"];
90
+ default: "dd";
91
+ };
92
+ };
93
+
94
+ export { dataListItemPropDefs, dataListLabelAs, dataListLabelPropDefs, dataListRootAs, dataListRootPropDefs, dataListValueAs, dataListValuePropDefs };