@primer/styled-react 0.0.0-20251013051849 → 0.0.0-20251013164644

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.
@@ -5,14 +5,22 @@ import type { ForwardRefComponent } from '../polymorphic';
5
5
  type PrimerActionListTrailingActionProps = React.ComponentProps<typeof PrimerActionList.TrailingAction>;
6
6
  export type ActionListProps<As extends React.ElementType = 'ul'> = PrimerActionListProps<As> & SxProp;
7
7
  export type ActionListItemProps = React.PropsWithChildren<PrimerActionListItemProps & SxProp>;
8
- export type ActionListLinkItemProps = React.PropsWithChildren<PrimerActionListLinkItemProps & SxProp>;
9
- export type ActionListGroupProps = React.PropsWithChildren<PrimerActionListGroupProps & SxProp>;
8
+ export type ActionListLinkItemProps = React.PropsWithChildren<PrimerActionListLinkItemProps & SxProp> & {
9
+ as?: React.ElementType;
10
+ };
11
+ export type ActionListGroupProps = React.PropsWithChildren<PrimerActionListGroupProps & SxProp> & {
12
+ as?: React.ElementType;
13
+ };
10
14
  export type ActionListDividerProps = React.PropsWithChildren<PrimerActionListDividerProps & SxProp>;
11
- export type ActionListLeadingVisualProps = React.PropsWithChildren<PrimerActionListLeadingVisualProps & SxProp>;
12
- export type ActionListTrailingVisualProps = React.PropsWithChildren<PrimerActionListTrailingVisualProps & SxProp>;
15
+ export type ActionListLeadingVisualProps = React.PropsWithChildren<PrimerActionListLeadingVisualProps & SxProp> & {
16
+ as?: React.ElementType;
17
+ };
18
+ export type ActionListTrailingVisualProps = React.PropsWithChildren<PrimerActionListTrailingVisualProps & SxProp> & {
19
+ as?: React.ElementType;
20
+ };
13
21
  export type ActionListTrailingActionProps = React.PropsWithChildren<PrimerActionListTrailingActionProps & SxProp>;
14
22
  declare const ActionListImpl: React.ForwardRefExoticComponent<Omit<ActionListProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
15
- declare const ActionListLinkItem: ForwardRefComponent<'a', ActionListLinkItemProps> & SlotMarker;
23
+ declare const ActionListLinkItem: ForwardRefComponent<"a", ActionListLinkItemProps> & SlotMarker;
16
24
  type TrailingActionElements = 'button' | 'a';
17
25
  declare const ActionListTrailingAction: ForwardRefComponent<TrailingActionElements, ActionListTrailingActionProps> & SlotMarker;
18
26
  declare const ActionListItem: ForwardRefComponent<"li", ActionListItemProps> & SlotMarker;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionList.d.ts","sourceRoot":"","sources":["../../src/components/ActionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,mBAAmB,IAAI,yBAAyB,EACrD,KAAK,uBAAuB,IAAI,6BAA6B,EAC7D,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,sBAAsB,IAAI,4BAA4B,EAC3D,KAAK,4BAA4B,IAAI,kCAAkC,EACvE,KAAK,6BAA6B,IAAI,mCAAmC,EACzE,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAEvD,KAAK,mCAAmC,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAA;AAEvG,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,IAAI,IAAI,qBAAqB,CAAC,EAAE,CAAC,GAAG,MAAM,CAAA;AACrG,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,GAAG,MAAM,CAAC,CAAA;AAC7F,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,iBAAiB,CAAC,6BAA6B,GAAG,MAAM,CAAC,CAAA;AACrG,MAAM,MAAM,oBAAoB,GAAG,KA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K,CAAC,aAAa,CAAC,oBAAoB,CAAC,GAAG,UAIlE,CAAA;AAGD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,GAAG,UAMtE,CAAA;AAUD,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,aAAa,CAAC,4BAA4B,CAAC,GAAG,UAQlF,CAAA;AAWD,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,aAAa,CAAC,6BAA6B,CAAC,GAAG,UAQpF,CAAA;AAGD,eAAO,MAAM,UAAU,EAAE,OAAO,cAAc,GAAG;IAC/C,IAAI,EAAE,OAAO,cAAc,CAAA;IAC3B,QAAQ,EAAE,OAAO,kBAAkB,CAAA;IACnC,KAAK,EAAE,OAAO,eAAe,CAAA;IAC7B,YAAY,EAAE,OAAO,gBAAgB,CAAC,YAAY,CAAA;IAClD,OAAO,EAAE,OAAO,iBAAiB,CAAA;IACjC,WAAW,EAAE,OAAO,gBAAgB,CAAC,WAAW,CAAA;IAChD,aAAa,EAAE,OAAO,uBAAuB,CAAA;IAC7C,cAAc,EAAE,OAAO,wBAAwB,CAAA;IAC/C,OAAO,EAAE,OAAO,gBAAgB,CAAC,OAAO,CAAA;IACxC,cAAc,EAAE,OAAO,wBAAwB,CAAA;CAChD,GAAG,UAWF,CAAA"}
@@ -21,12 +21,25 @@ const ActionListImpl = /*#__PURE__*/React.forwardRef(function ActionListImpl({
21
21
  } : {})
22
22
  });
23
23
  });
24
- const ActionListLinkItem = styled(ActionList$1.LinkItem).withConfig({
24
+ const StyledActionListLinkItem = styled(ActionList$1.LinkItem).withConfig({
25
25
  shouldForwardProp: prop => prop !== 'sx'
26
26
  }).withConfig({
27
- displayName: "ActionList__ActionListLinkItem",
27
+ displayName: "ActionList__StyledActionListLinkItem",
28
28
  componentId: "sc-hw2362-1"
29
29
  })(["", ""], sx);
30
+ const ActionListLinkItem = /*#__PURE__*/React.forwardRef(({
31
+ children,
32
+ as,
33
+ ...props
34
+ }, ref) => /*#__PURE__*/jsx(StyledActionListLinkItem, {
35
+ ref: ref,
36
+ ...props,
37
+ ...(as ? {
38
+ forwardedAs: as
39
+ } : {}),
40
+ children: children
41
+ }));
42
+ ActionListLinkItem.displayName = 'ActionList.LinkItem';
30
43
  const StyledActionListTrailingAction = styled(ActionList$1.TrailingAction).withConfig({
31
44
  shouldForwardProp: prop => prop !== 'sx'
32
45
  }).withConfig({
@@ -64,30 +77,66 @@ const ActionListItem = /*#__PURE__*/React.forwardRef(({
64
77
  } : {}),
65
78
  children: children
66
79
  }));
67
- const ActionListGroup = styled(ActionList$1.Group).withConfig({
80
+ const StyledActionListGroup = styled(ActionList$1.Group).withConfig({
68
81
  shouldForwardProp: prop => prop !== 'sx'
69
82
  }).withConfig({
70
- displayName: "ActionList__ActionListGroup",
83
+ displayName: "ActionList__StyledActionListGroup",
71
84
  componentId: "sc-hw2362-4"
72
85
  })(["", ""], sx);
86
+ const ActionListGroup = ({
87
+ children,
88
+ as,
89
+ ...props
90
+ }) => /*#__PURE__*/jsx(StyledActionListGroup, {
91
+ ...props,
92
+ ...(as ? {
93
+ forwardedAs: as
94
+ } : {}),
95
+ children: children
96
+ });
97
+ ActionListGroup.displayName = 'ActionList.Group';
73
98
  const ActionListDivider = styled(ActionList$1.Divider).withConfig({
74
99
  shouldForwardProp: prop => prop !== 'sx'
75
100
  }).withConfig({
76
101
  displayName: "ActionList__ActionListDivider",
77
102
  componentId: "sc-hw2362-5"
78
103
  })(["", ""], sx);
79
- const ActionListLeadingVisual = styled(ActionList$1.LeadingVisual).withConfig({
104
+ const StyledActionListLeadingVisual = styled(ActionList$1.LeadingVisual).withConfig({
80
105
  shouldForwardProp: prop => prop !== 'sx'
81
106
  }).withConfig({
82
- displayName: "ActionList__ActionListLeadingVisual",
107
+ displayName: "ActionList__StyledActionListLeadingVisual",
83
108
  componentId: "sc-hw2362-6"
84
109
  })(["", ""], sx);
85
- const ActionListTrailingVisual = styled(ActionList$1.TrailingVisual).withConfig({
110
+ const ActionListLeadingVisual = ({
111
+ children,
112
+ as,
113
+ ...props
114
+ }) => /*#__PURE__*/jsx(StyledActionListLeadingVisual, {
115
+ ...props,
116
+ ...(as ? {
117
+ forwardedAs: as
118
+ } : {}),
119
+ children: children
120
+ });
121
+ ActionListLeadingVisual.displayName = 'ActionList.LeadingVisual';
122
+ const StyledActionListTrailingVisual = styled(ActionList$1.TrailingVisual).withConfig({
86
123
  shouldForwardProp: prop => prop !== 'sx'
87
124
  }).withConfig({
88
- displayName: "ActionList__ActionListTrailingVisual",
125
+ displayName: "ActionList__StyledActionListTrailingVisual",
89
126
  componentId: "sc-hw2362-7"
90
127
  })(["", ""], sx);
128
+ const ActionListTrailingVisual = ({
129
+ children,
130
+ as,
131
+ ...props
132
+ }) => /*#__PURE__*/jsx(StyledActionListTrailingVisual, {
133
+ ...props,
134
+ ...(as ? {
135
+ forwardedAs: as
136
+ } : {}),
137
+ children: children
138
+ });
139
+ ActionListTrailingVisual.displayName = 'ActionList.TrailingVisual';
91
140
  const ActionList = Object.assign(ActionListImpl, {
92
141
  Item: ActionListItem,
93
142
  LinkItem: ActionListLinkItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/styled-react",
3
- "version": "0.0.0-20251013051849",
3
+ "version": "0.0.0-20251013164644",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@babel/preset-react": "^7.27.1",
32
32
  "@babel/preset-typescript": "^7.27.1",
33
- "@primer/react": "0.0.0-20251013051849",
33
+ "@primer/react": "0.0.0-20251013164644",
34
34
  "@rollup/plugin-babel": "^6.0.4",
35
35
  "@types/react": "18.3.11",
36
36
  "@types/react-dom": "18.3.1",
@@ -46,7 +46,7 @@
46
46
  "typescript": "^5.9.2"
47
47
  },
48
48
  "peerDependencies": {
49
- "@primer/react": "0.0.0-20251013051849",
49
+ "@primer/react": "0.0.0-20251013164644",
50
50
  "@types/react": "18.x || 19.x",
51
51
  "@types/react-dom": "18.x || 19.x",
52
52
  "@types/react-is": "18.x || 19.x",