@telegraph/data-list 0.0.9 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @telegraph/data-list
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#701](https://github.com/knocklabs/telegraph/pull/701) [`16e678c`](https://github.com/knocklabs/telegraph/commit/16e678c5e8bc7f13613116954bc15099a8694bb7) Thanks [@ksorathia](https://github.com/ksorathia)! - Add surface-3 background color for interactive outlined variants.
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#688](https://github.com/knocklabs/telegraph/pull/688) [`8d55540`](https://github.com/knocklabs/telegraph/commit/8d5554005bea4695560efbee9ea4333ccddfc1bf) Thanks [@kylemcd](https://github.com/kylemcd)! - fix: invalid props on components would not throw type errors
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [[`8d55540`](https://github.com/knocklabs/telegraph/commit/8d5554005bea4695560efbee9ea4333ccddfc1bf)]:
18
+ - @telegraph/typography@0.2.0
19
+ - @telegraph/tooltip@0.1.0
20
+ - @telegraph/layout@0.4.0
21
+ - @telegraph/icon@0.4.0
22
+
3
23
  ## 0.0.9
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -45,7 +45,7 @@ Container component that wraps data list items.
45
45
  | ------------- | ---------------------- | ---------- | ------------------------------------- |
46
46
  | `direction` | `"column" \| "row"` | `"column"` | Layout direction of list items |
47
47
  | `gap` | `keyof tokens.spacing` | `"4"` | Gap between list items |
48
- | All Box props | - | - | Inherits all Box component properties |
48
+ | All Stack props | - | - | Inherits all Stack component properties |
49
49
 
50
50
  ### `<DataList.Item>`
51
51
 
@@ -335,29 +335,6 @@ export const InteractiveList = () => {
335
335
  };
336
336
  ```
337
337
 
338
- ### Responsive Layout
339
-
340
- ```tsx
341
- import { DataList } from "@telegraph/data-list";
342
- import { Text } from "@telegraph/typography";
343
- import { useMediaQuery } from "your-hooks";
344
-
345
- export const ResponsiveList = () => {
346
- const isMobile = useMediaQuery("(max-width: 768px)");
347
-
348
- return (
349
- <DataList.List>
350
- <DataList.Item
351
- label="Description"
352
- direction={isMobile ? "column" : "row"}
353
- >
354
- <Text as="span">This switches to column layout on mobile devices</Text>
355
- </DataList.Item>
356
- </DataList.List>
357
- );
358
- };
359
- ```
360
-
361
338
  ### User Settings Example
362
339
 
363
340
  ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/DataList/DataList.tsx"],"sourcesContent":["import { TgphComponentProps } from \"@telegraph/helpers\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\ntype ListProps = TgphComponentProps<typeof Stack>;\n\nconst List = ({ direction = \"column\", gap = \"4\", ...props }: ListProps) => {\n return <Stack direction={direction} gap={gap} {...props} />;\n};\n\ntype ListItemProps = TgphComponentProps<typeof Stack>;\n\nconst ListItem = ({\n direction = \"row\",\n gap = \"1\",\n align = \"baseline\",\n ...props\n}: ListItemProps) => {\n return <Stack direction={direction} gap={gap} align={align} {...props} />;\n};\n\ntype LabelProps = {\n textProps?: TgphComponentProps<typeof Text>;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n tooltipProps?: Omit<\n Partial<TgphComponentProps<typeof Tooltip>>,\n \"enabled\" | \"label\"\n >;\n} & TgphComponentProps<typeof Stack>;\n\nconst Label = ({\n maxW = \"36\",\n maxH = \"6\",\n w = \"full\",\n icon,\n children,\n textProps,\n description,\n tooltipProps,\n ...props\n}: LabelProps) => {\n const {\n color = \"gray\",\n weight = \"medium\",\n size = \"1\",\n ...restTextProps\n } = textProps || {};\n\n return (\n <Stack\n direction=\"row\"\n align=\"baseline\"\n gap=\"2\"\n maxW={maxW}\n w={w}\n maxH={maxH}\n {...props}\n >\n {icon && (\n <Stack alignSelf=\"center\">\n <Icon size=\"1\" color=\"gray\" {...icon} />\n </Stack>\n )}\n <Tooltip label={description} enabled={!!description} {...tooltipProps}>\n <Text\n as=\"label\"\n {...restTextProps}\n color={color}\n weight={weight}\n size={size}\n borderBottom={description ? \"px\" : undefined}\n borderStyle={description ? \"dashed\" : undefined}\n >\n {children}\n </Text>\n </Tooltip>\n </Stack>\n );\n};\n\ntype ValueProps = TgphComponentProps<typeof Stack>;\n\nconst Value = ({ ...props }: ValueProps) => {\n return <Stack {...props} />;\n};\n\ntype ItemProps = ListItemProps & {\n label: React.ReactNode | string;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n labelProps?: TgphComponentProps<typeof Label>;\n valueProps?: TgphComponentProps<typeof Value>;\n};\n\nconst Item = ({\n label,\n direction,\n icon,\n children,\n description,\n labelProps,\n valueProps,\n ...props\n}: ItemProps) => {\n return (\n <ListItem direction={direction} {...props}>\n <Label icon={icon} description={description} {...labelProps}>\n {label}\n </Label>\n <Value {...valueProps}>{children}</Value>\n </ListItem>\n );\n};\n\nconst DataList = {\n List,\n ListItem,\n Label,\n Value,\n Item,\n};\n\nexport { DataList };\n"],"names":["List","direction","gap","props","jsx","Stack","ListItem","align","Label","maxW","maxH","w","icon","children","textProps","description","tooltipProps","color","weight","size","restTextProps","jsxs","Icon","Tooltip","Text","Value","Item","label","labelProps","valueProps","DataList"],"mappings":"oPASMA,EAAO,CAAC,CAAE,UAAAC,EAAY,SAAU,IAAAC,EAAM,IAAK,GAAGC,KAC3CC,EAAAA,IAACC,EAAAA,MAAA,CAAM,UAAAJ,EAAsB,IAAAC,EAAW,GAAGC,EAAO,EAKrDG,EAAW,CAAC,CAChB,UAAAL,EAAY,MACZ,IAAAC,EAAM,IACN,MAAAK,EAAQ,WACR,GAAGJ,CACL,UACUE,EAAAA,MAAA,CAAM,UAAAJ,EAAsB,IAAAC,EAAU,MAAAK,EAAe,GAAGJ,EAAO,EAanE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I,EAAa,SAAAhB,CAAA,CAAS,CAAA,EACnC,EAIEiB,EAAW,CACf,KAAA9B,EACA,SAAAM,EACA,MAAAE,EACA,MAAAiB,EACA,KAAAC,CACF"}
1
+ {"version":3,"file":"index.js","sources":["../../src/DataList/DataList.tsx"],"sourcesContent":["import { TgphComponentProps } from \"@telegraph/helpers\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nexport type ListProps = TgphComponentProps<typeof Stack>;\n\nconst List = ({ direction = \"column\", gap = \"4\", ...props }: ListProps) => {\n return <Stack direction={direction} gap={gap} {...props} />;\n};\n\nexport type ListItemProps = TgphComponentProps<typeof Stack>;\n\nconst ListItem = ({\n direction = \"row\",\n gap = \"1\",\n align = \"baseline\",\n ...props\n}: ListItemProps) => {\n return <Stack direction={direction} gap={gap} align={align} {...props} />;\n};\n\nexport type LabelProps = {\n textProps?: TgphComponentProps<typeof Text>;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n tooltipProps?: Omit<\n Partial<TgphComponentProps<typeof Tooltip>>,\n \"enabled\" | \"label\"\n >;\n} & TgphComponentProps<typeof Stack>;\n\nconst Label = ({\n maxW = \"36\",\n maxH = \"6\",\n w = \"full\",\n icon,\n children,\n textProps,\n description,\n tooltipProps,\n ...props\n}: LabelProps) => {\n const {\n color = \"gray\",\n weight = \"medium\",\n size = \"1\",\n ...restTextProps\n } = textProps || {};\n\n return (\n <Stack\n direction=\"row\"\n align=\"baseline\"\n gap=\"2\"\n maxW={maxW}\n w={w}\n maxH={maxH}\n {...props}\n >\n {icon && (\n <Stack alignSelf=\"center\">\n <Icon size=\"1\" color=\"gray\" {...icon} />\n </Stack>\n )}\n <Tooltip label={description} enabled={!!description} {...tooltipProps}>\n <Text\n as=\"label\"\n {...restTextProps}\n color={color}\n weight={weight}\n size={size}\n borderBottom={description ? \"px\" : undefined}\n borderStyle={description ? \"dashed\" : undefined}\n >\n {children}\n </Text>\n </Tooltip>\n </Stack>\n );\n};\n\nexport type ValueProps = TgphComponentProps<typeof Stack>;\n\nconst Value = ({ ...props }: ValueProps) => {\n return <Stack {...props} />;\n};\n\nexport type ItemProps = ListItemProps & {\n label: React.ReactNode | string;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n labelProps?: TgphComponentProps<typeof Label>;\n valueProps?: TgphComponentProps<typeof Value>;\n};\n\nconst Item = ({\n label,\n direction,\n icon,\n children,\n description,\n labelProps,\n valueProps,\n ...props\n}: ItemProps) => {\n return (\n <ListItem direction={direction} {...props}>\n <Label icon={icon} description={description} {...labelProps}>\n {label}\n </Label>\n <Value {...valueProps}>{children}</Value>\n </ListItem>\n );\n};\n\nconst DataList = {\n List,\n ListItem,\n Label,\n Value,\n Item,\n};\n\nexport { DataList };\n"],"names":["List","direction","gap","props","jsx","Stack","ListItem","align","Label","maxW","maxH","w","icon","children","textProps","description","tooltipProps","color","weight","size","restTextProps","jsxs","Icon","Tooltip","Text","Value","Item","label","labelProps","valueProps","DataList"],"mappings":"oPASMA,EAAO,CAAC,CAAE,UAAAC,EAAY,SAAU,IAAAC,EAAM,IAAK,GAAGC,KAC3CC,EAAAA,IAACC,EAAAA,MAAA,CAAM,UAAAJ,EAAsB,IAAAC,EAAW,GAAGC,EAAO,EAKrDG,EAAW,CAAC,CAChB,UAAAL,EAAY,MACZ,IAAAC,EAAM,IACN,MAAAK,EAAQ,WACR,GAAGJ,CACL,UACUE,EAAAA,MAAA,CAAM,UAAAJ,EAAsB,IAAAC,EAAU,MAAAK,EAAe,GAAGJ,EAAO,EAanEK,EAAQ,CAAC,CACb,KAAAC,EAAO,KACP,KAAAC,EAAO,IACP,EAAAC,EAAI,OAAA,KACJC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,aAAAC,EACA,GAAGb,CACL,IAAkB,CAChB,KAAM,CACJ,MAAAc,EAAQ,OACR,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cesContent":["import { TgphComponentProps } from \"@telegraph/helpers\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\ntype ListProps = TgphComponentProps<typeof Stack>;\n\nconst List = ({ direction = \"column\", gap = \"4\", ...props }: ListProps) => {\n return <Stack direction={direction} gap={gap} {...props} />;\n};\n\ntype ListItemProps = TgphComponentProps<typeof Stack>;\n\nconst ListItem = ({\n direction = \"row\",\n gap = \"1\",\n align = \"baseline\",\n ...props\n}: ListItemProps) => {\n return <Stack direction={direction} gap={gap} align={align} {...props} />;\n};\n\ntype LabelProps = {\n textProps?: TgphComponentProps<typeof Text>;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n tooltipProps?: Omit<\n Partial<TgphComponentProps<typeof Tooltip>>,\n \"enabled\" | \"label\"\n >;\n} & TgphComponentProps<typeof Stack>;\n\nconst Label = ({\n maxW = \"36\",\n maxH = \"6\",\n w = \"full\",\n icon,\n children,\n textProps,\n description,\n tooltipProps,\n ...props\n}: LabelProps) => {\n const {\n color = \"gray\",\n weight = \"medium\",\n size = \"1\",\n ...restTextProps\n } = textProps || {};\n\n return (\n <Stack\n direction=\"row\"\n align=\"baseline\"\n gap=\"2\"\n maxW={maxW}\n w={w}\n maxH={maxH}\n {...props}\n >\n {icon && (\n <Stack alignSelf=\"center\">\n <Icon size=\"1\" color=\"gray\" {...icon} />\n </Stack>\n )}\n <Tooltip label={description} enabled={!!description} {...tooltipProps}>\n <Text\n as=\"label\"\n {...restTextProps}\n color={color}\n weight={weight}\n size={size}\n borderBottom={description ? \"px\" : undefined}\n borderStyle={description ? \"dashed\" : undefined}\n >\n {children}\n </Text>\n </Tooltip>\n </Stack>\n );\n};\n\ntype ValueProps = TgphComponentProps<typeof Stack>;\n\nconst Value = ({ ...props }: ValueProps) => {\n return <Stack {...props} />;\n};\n\ntype ItemProps = ListItemProps & {\n label: React.ReactNode | string;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n labelProps?: TgphComponentProps<typeof Label>;\n valueProps?: TgphComponentProps<typeof Value>;\n};\n\nconst Item = ({\n label,\n direction,\n icon,\n children,\n description,\n labelProps,\n valueProps,\n ...props\n}: ItemProps) => {\n return (\n <ListItem direction={direction} {...props}>\n <Label icon={icon} description={description} {...labelProps}>\n {label}\n </Label>\n <Value {...valueProps}>{children}</Value>\n </ListItem>\n );\n};\n\nconst DataList = {\n List,\n ListItem,\n Label,\n Value,\n Item,\n};\n\nexport { DataList };\n"],"names":["List","direction","gap","props","jsx","Stack","ListItem","align","Label","maxW","maxH","w","icon","children","textProps","description","tooltipProps","color","weight","size","restTextProps","jsxs","Icon","Tooltip","Text","Value","Item","label","labelProps","valueProps","DataList"],"mappings":";;;;;AASA,MAAMA,IAAO,CAAC,EAAE,WAAAC,IAAY,UAAU,KAAAC,IAAM,KAAK,GAAGC,QAC3C,gBAAAC,EAACC,GAAA,EAAM,WAAAJ,GAAsB,KAAAC,GAAW,GAAGC,GAAO,GAKrDG,IAAW,CAAC;AAAA,EAChB,WAAAL,IAAY;AAAA,EACZ,KAAAC,IAAM;AAAA,EACN,OAAAK,IAAQ;AAAA,EACR,GAAGJ;AACL,wBACUE,GAAA,EAAM,WAAAJ,GAAsB,KAAAC,GAAU,OAAAK,GAAe,GAAGJ,GAAO,GAanEK,IAAQ,CAAC;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,GAAAC,IAAI;AAAA,EACJ,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGb;AACL,MAAkB;AAChB,QAAM;AAAA,IACJ,OAAAc,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EAAA,IACDN,KAAa,CAAA;AAEjB,S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;AAAA,EACA,UAAAM;AAAA,EACA,OAAAE;AAAA,EACA,OAAAiB;AAAA,EACA,MAAAC;AACF;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/DataList/DataList.tsx"],"sourcesContent":["import { TgphComponentProps } from \"@telegraph/helpers\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nexport type ListProps = TgphComponentProps<typeof Stack>;\n\nconst List = ({ direction = \"column\", gap = \"4\", ...props }: ListProps) => {\n return <Stack direction={direction} gap={gap} {...props} />;\n};\n\nexport type ListItemProps = TgphComponentProps<typeof Stack>;\n\nconst ListItem = ({\n direction = \"row\",\n gap = \"1\",\n align = \"baseline\",\n ...props\n}: ListItemProps) => {\n return <Stack direction={direction} gap={gap} align={align} {...props} />;\n};\n\nexport type LabelProps = {\n textProps?: TgphComponentProps<typeof Text>;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n tooltipProps?: Omit<\n Partial<TgphComponentProps<typeof Tooltip>>,\n \"enabled\" | \"label\"\n >;\n} & TgphComponentProps<typeof Stack>;\n\nconst Label = ({\n maxW = \"36\",\n maxH = \"6\",\n w = \"full\",\n icon,\n children,\n textProps,\n description,\n tooltipProps,\n ...props\n}: LabelProps) => {\n const {\n color = \"gray\",\n weight = \"medium\",\n size = \"1\",\n ...restTextProps\n } = textProps || {};\n\n return (\n <Stack\n direction=\"row\"\n align=\"baseline\"\n gap=\"2\"\n maxW={maxW}\n w={w}\n maxH={maxH}\n {...props}\n >\n {icon && (\n <Stack alignSelf=\"center\">\n <Icon size=\"1\" color=\"gray\" {...icon} />\n </Stack>\n )}\n <Tooltip label={description} enabled={!!description} {...tooltipProps}>\n <Text\n as=\"label\"\n {...restTextProps}\n color={color}\n weight={weight}\n size={size}\n borderBottom={description ? \"px\" : undefined}\n borderStyle={description ? \"dashed\" : undefined}\n >\n {children}\n </Text>\n </Tooltip>\n </Stack>\n );\n};\n\nexport type ValueProps = TgphComponentProps<typeof Stack>;\n\nconst Value = ({ ...props }: ValueProps) => {\n return <Stack {...props} />;\n};\n\nexport type ItemProps = ListItemProps & {\n label: React.ReactNode | string;\n icon?: TgphComponentProps<typeof Icon>;\n description?: React.ReactNode;\n labelProps?: TgphComponentProps<typeof Label>;\n valueProps?: TgphComponentProps<typeof Value>;\n};\n\nconst Item = ({\n label,\n direction,\n icon,\n children,\n description,\n labelProps,\n valueProps,\n ...props\n}: ItemProps) => {\n return (\n <ListItem direction={direction} {...props}>\n <Label icon={icon} description={description} {...labelProps}>\n {label}\n </Label>\n <Value {...valueProps}>{children}</Value>\n </ListItem>\n );\n};\n\nconst DataList = {\n List,\n ListItem,\n Label,\n Value,\n Item,\n};\n\nexport { DataList };\n"],"names":["List","direction","gap","props","jsx","Stack","ListItem","align","Label","maxW","maxH","w","icon","children","textProps","description","tooltipProps","color","weight","size","restTextProps","jsxs","Icon","Tooltip","Text","Value","Item","label","labelProps","valueProps","DataList"],"mappings":";;;;;AASA,MAAMA,IAAO,CAAC,EAAE,WAAAC,IAAY,UAAU,KAAAC,IAAM,KAAK,GAAGC,QAC3C,gBAAAC,EAACC,GAAA,EAAM,WAAAJ,GAAsB,KAAAC,GAAW,GAAGC,GAAO,GAKrDG,IAAW,CAAC;AAAA,EAChB,WAAAL,IAAY;AAAA,EACZ,KAAAC,IAAM;AAAA,EACN,OAAAK,IAAQ;AAAA,EACR,GAAGJ;AACL,wBACUE,GAAA,EAAM,WAAAJ,GAAsB,KAAAC,GAAU,OAAAK,GAAe,GAAGJ,GAAO,GAanEK,IAAQ,CAAC;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,GAAAC,IAAI;AAAA,EACJ,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGb;AACL,MAAkB;A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AGa,GAC9C,UAAAD,GACH;AAAA,EACA,gBAAAvB,EAACqB,GAAA,EAAO,GAAGI,GAAa,UAAAhB,EAAA,CAAS;AAAA,GACnC,GAIEiB,IAAW;AAAA,EACf,MAAA9B;AAAA,EACA,UAAAM;AAAA,EACA,OAAAE;AAAA,EACA,OAAAiB;AAAA,EACA,MAAAC;AACF;"}
@@ -4,18 +4,18 @@ import { Stack } from '@telegraph/layout';
4
4
  import { Tooltip } from '@telegraph/tooltip';
5
5
  import { Text } from '@telegraph/typography';
6
6
  import { default as React } from 'react';
7
- type ListProps = TgphComponentProps<typeof Stack>;
8
- type ListItemProps = TgphComponentProps<typeof Stack>;
9
- type LabelProps = {
7
+ export type ListProps = TgphComponentProps<typeof Stack>;
8
+ export type ListItemProps = TgphComponentProps<typeof Stack>;
9
+ export type LabelProps = {
10
10
  textProps?: TgphComponentProps<typeof Text>;
11
11
  icon?: TgphComponentProps<typeof Icon>;
12
12
  description?: React.ReactNode;
13
13
  tooltipProps?: Omit<Partial<TgphComponentProps<typeof Tooltip>>, "enabled" | "label">;
14
14
  } & TgphComponentProps<typeof Stack>;
15
15
  declare const Label: ({ maxW, maxH, w, icon, children, textProps, description, tooltipProps, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
16
- type ValueProps = TgphComponentProps<typeof Stack>;
16
+ export type ValueProps = TgphComponentProps<typeof Stack>;
17
17
  declare const Value: ({ ...props }: ValueProps) => import("react/jsx-runtime").JSX.Element;
18
- type ItemProps = ListItemProps & {
18
+ export type ItemProps = ListItemProps & {
19
19
  label: React.ReactNode | string;
20
20
  icon?: TgphComponentProps<typeof Icon>;
21
21
  description?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"DataList.d.ts","sourceRoot":"","sources":["../../../src/DataList/DataList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,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AAS,GAAG,aAAa,GAAG;IACtC,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IAChC,IAAI,CAAC,EAAE,kBAAkB,CAAC,OAAO,IAAI,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,kBAAkB,CAAC,OAAO,KAAK,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,kBAAkB,CAAC,OAAO,KAAK,CAAC,CAAC;CAC/C,CAAC;AAsBF,QAAA,MAAM,QAAQ;yCA7G+C,SAAS;oDAWnE,aAAa;+FAwBb,UAAU;0BA0CgB,UAAU;gGAqBpC,SAAS;CAiBX,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { DataList } from './DataList';
2
+ export type { ListProps as DataListListProps, ListItemProps as DataListListItemProps, LabelProps as DataListLabelProps, ValueProps as DataListValueProps, ItemProps as DataListItemProps, } from './DataList';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DataList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DataList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,SAAS,IAAI,iBAAiB,EAC9B,aAAa,IAAI,qBAAqB,EACtC,UAAU,IAAI,kBAAkB,EAChC,UAAU,IAAI,kBAAkB,EAChC,SAAS,IAAI,iBAAiB,GAC/B,MAAM,YAAY,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { DataList } from './DataList';
2
+ export type { DataListListProps, DataListListItemProps, DataListLabelProps, DataListValueProps, DataListItemProps, } from './DataList';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegraph/data-list",
3
- "version": "0.0.9",
3
+ "version": "0.1.1",
4
4
  "description": "Flexible data list component for displaying label-value pairs in a structured, composable format.",
5
5
  "repository": "https://github.com/knocklabs/telegraph/tree/main/packages/data-list",
6
6
  "author": "@knocklabs",
@@ -31,10 +31,10 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@telegraph/helpers": "^0.0.15",
34
- "@telegraph/icon": "^0.3.5",
35
- "@telegraph/layout": "^0.3.3",
36
- "@telegraph/tooltip": "^0.0.62",
37
- "@telegraph/typography": "^0.1.29"
34
+ "@telegraph/icon": "^0.4.0",
35
+ "@telegraph/layout": "^0.4.0",
36
+ "@telegraph/tooltip": "^0.1.2",
37
+ "@telegraph/typography": "^0.2.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@knocklabs/eslint-config": "^0.0.5",
@@ -43,9 +43,9 @@
43
43
  "@telegraph/prettier-config": "^0.0.7",
44
44
  "@telegraph/vite-config": "^0.0.15",
45
45
  "@types/react": "^19.2.9",
46
- "eslint": "^8.56.0",
47
- "react": "^19.2.3",
48
- "react-dom": "^19.2.3",
46
+ "eslint": "^10.0.2",
47
+ "react": "^19.2.4",
48
+ "react-dom": "^19.2.4",
49
49
  "typescript": "^5.9.3",
50
50
  "vite": "^6.4.1"
51
51
  },