@stratakit/structures 0.1.0 → 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.
@@ -0,0 +1,46 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Role } from "@ariakit/react/role";
3
+ import { Text } from "@stratakit/bricks";
4
+ import { forwardRef } from "@stratakit/foundations/secret-internals";
5
+ import cx from "classnames";
6
+ const ListItem = forwardRef((props, forwardedRef) => {
7
+ return /* @__PURE__ */ jsx(
8
+ Role.div,
9
+ {
10
+ role: "listitem",
11
+ ...props,
12
+ className: cx("\u{1F95D}-list-item", props.className),
13
+ ref: forwardedRef
14
+ }
15
+ );
16
+ });
17
+ const ListItemContent = forwardRef(
18
+ (props, forwardedRef) => {
19
+ return /* @__PURE__ */ jsx(
20
+ Text,
21
+ {
22
+ ...props,
23
+ variant: "body-sm",
24
+ className: cx("\u{1F95D}-list-item-content", props.className),
25
+ ref: forwardedRef
26
+ }
27
+ );
28
+ }
29
+ );
30
+ const ListItemDecoration = forwardRef(
31
+ (props, forwardedRef) => {
32
+ return /* @__PURE__ */ jsx(
33
+ Role.div,
34
+ {
35
+ ...props,
36
+ className: cx("\u{1F95D}-list-item-decoration", props.className),
37
+ ref: forwardedRef
38
+ }
39
+ );
40
+ }
41
+ );
42
+ export {
43
+ ListItemContent as Content,
44
+ ListItemDecoration as Decoration,
45
+ ListItem as Root
46
+ };
@@ -0,0 +1,10 @@
1
+ import type { BaseProps } from "@stratakit/foundations/secret-internals";
2
+ export declare const Checkmark: import("react").ForwardRefExoticComponent<Omit<BaseProps<"svg">, "children"> & import("react").RefAttributes<HTMLElement | SVGSVGElement>>;
3
+ export declare const Dismiss: import("react").ForwardRefExoticComponent<Omit<BaseProps<"svg">, "children"> & import("react").RefAttributes<HTMLElement | SVGSVGElement>>;
4
+ interface StatusIconProps extends Omit<BaseProps<"svg">, "children"> {
5
+ tone: "positive" | "attention" | "critical" | "info";
6
+ }
7
+ export declare const StatusIcon: import("react").ForwardRefExoticComponent<StatusIconProps & import("react").RefAttributes<HTMLElement | SVGSVGElement>>;
8
+ export declare const MoreHorizontal: import("react").ForwardRefExoticComponent<Omit<BaseProps<"svg">, "children"> & import("react").RefAttributes<HTMLElement | SVGSVGElement>>;
9
+ export declare const ChevronDown: import("react").ForwardRefExoticComponent<Omit<BaseProps<"svg">, "children"> & import("react").RefAttributes<HTMLElement | SVGSVGElement>>;
10
+ export {};
@@ -0,0 +1,56 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ createIconFromPath,
4
+ forwardRef
5
+ } from "@stratakit/foundations/secret-internals";
6
+ import cx from "classnames";
7
+ const Checkmark = createIconFromPath(
8
+ "M13.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L6.5 10.793l6.646-6.647a.5.5 0 0 1 .708 0Z"
9
+ );
10
+ const Dismiss = createIconFromPath(
11
+ "M4.853 4.146a.5.5 0 1 0-.707.708L7.293 8l-3.147 3.146a.5.5 0 0 0 .707.708L8 8.707l3.146 3.147a.5.5 0 0 0 .707-.708L8.707 8l3.146-3.146a.5.5 0 1 0-.707-.708L8 7.293 4.853 4.146Z"
12
+ );
13
+ const statusIcons = {
14
+ positive: createIconFromPath(
15
+ "M7.748 1.726a.5.5 0 0 1 .504 0l5 2.916a.5.5 0 0 1 .248.432v5.852a.5.5 0 0 1-.248.431l-5 2.917a.5.5 0 0 1-.504 0l-5-2.916a.5.5 0 0 1-.248-.432V5.074a.5.5 0 0 1 .248-.432l5-2.916ZM8.756.862a1.5 1.5 0 0 0-1.512 0l-5 2.917A1.5 1.5 0 0 0 1.5 5.074v5.852a1.5 1.5 0 0 0 .744 1.295l5 2.917a1.5 1.5 0 0 0 1.512 0l5-2.917a1.5 1.5 0 0 0 .744-1.295V5.074a1.5 1.5 0 0 0-.744-1.295l-5-2.917Zm2.139 5.445a.5.5 0 0 0-.79-.614L6.953 9.746l-1.1-1.1a.5.5 0 0 0-.707.708l1.5 1.5a.5.5 0 0 0 .749-.047l3.5-4.5Z"
16
+ ),
17
+ attention: createIconFromPath(
18
+ "M8.354 2.06a.5.5 0 0 0-.708 0L2.061 7.647a.5.5 0 0 0 0 .707l5.585 5.586a.5.5 0 0 0 .708 0l5.585-5.586a.5.5 0 0 0 0-.707L8.354 2.061Zm-1.415-.707a1.5 1.5 0 0 1 2.122 0l5.585 5.586a1.5 1.5 0 0 1 0 2.122l-5.585 5.585a1.5 1.5 0 0 1-2.122 0L1.354 9.061a1.5 1.5 0 0 1 0-2.122l5.585-5.586ZM8.75 10.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8.5 8.5v-3a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0Z"
19
+ ),
20
+ critical: createIconFromPath(
21
+ "M8.252 1.726a.5.5 0 0 0-.504 0l-5 2.916a.5.5 0 0 0-.248.432v5.852a.5.5 0 0 0 .248.431l5 2.917a.5.5 0 0 0 .504 0l5-2.916a.5.5 0 0 0 .248-.432V5.074a.5.5 0 0 0-.248-.432l-5-2.916ZM7.244.862a1.5 1.5 0 0 1 1.512 0l5 2.917a1.5 1.5 0 0 1 .744 1.295v5.852a1.5 1.5 0 0 1-.744 1.295l-5 2.917a1.5 1.5 0 0 1-1.512 0l-5-2.917a1.5 1.5 0 0 1-.744-1.295V5.074a1.5 1.5 0 0 1 .744-1.295l5-2.917ZM8.75 10.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8.5 5.5a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0v-3Z"
22
+ ),
23
+ info: createIconFromPath(
24
+ "M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8Zm5.5-1.5a.5.5 0 0 0 0 1h1v3h-1a.5.5 0 1 0 0 1h3a.5.5 0 0 0 0-1h-1V7a.5.5 0 0 0-.5-.5H6.5Zm1.375-1a.625.625 0 1 0 0-1.25.625.625 0 0 0 0 1.25Z"
25
+ )
26
+ };
27
+ const StatusIcon = forwardRef(
28
+ (props, forwardedRef) => {
29
+ const { tone, ...rest } = props;
30
+ const Element = statusIcons[tone];
31
+ return /* @__PURE__ */ jsx(Element, { ...rest, ref: forwardedRef });
32
+ }
33
+ );
34
+ const MoreHorizontal = createIconFromPath(
35
+ "M3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm6-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"
36
+ );
37
+ const ChevronDownBase = createIconFromPath(
38
+ "M4.146 6.146a.5.5 0 0 1 .708 0L8 9.293l3.146-3.147a.5.5 0 0 1 .708.708l-3.5 3.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 0 1 0-.708Z"
39
+ );
40
+ const ChevronDown = forwardRef((props, forwardedRef) => {
41
+ return /* @__PURE__ */ jsx(
42
+ ChevronDownBase,
43
+ {
44
+ ...props,
45
+ className: cx("\u{1F95D}-chevron-down", props.className),
46
+ ref: forwardedRef
47
+ }
48
+ );
49
+ });
50
+ export {
51
+ Checkmark,
52
+ ChevronDown,
53
+ Dismiss,
54
+ MoreHorizontal,
55
+ StatusIcon
56
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stratakit/structures",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@ariakit/react": "^0.4.17",
44
- "@stratakit/bricks": "^0.1.2",
44
+ "@stratakit/bricks": "^0.2.0",
45
45
  "classnames": "^2.5.1"
46
46
  },
47
47
  "devDependencies": {
@@ -52,10 +52,10 @@
52
52
  "react": "^19.1.0",
53
53
  "react-dom": "^19.1.0",
54
54
  "typescript": "~5.8.3",
55
- "@stratakit/foundations": "0.1.2"
55
+ "@stratakit/foundations": "0.1.3"
56
56
  },
57
57
  "peerDependencies": {
58
- "@stratakit/foundations": "^0.1.2",
58
+ "@stratakit/foundations": "^0.1.3",
59
59
  "react": ">=18.0.0",
60
60
  "react-dom": ">=18.0.0"
61
61
  },