@primer/styled-react 0.0.0-20260506112248 → 0.0.0-20260506175247

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.
Files changed (64) hide show
  1. package/dist/components/ActionList.d.ts +44 -0
  2. package/dist/components/ActionList.d.ts.map +1 -0
  3. package/dist/components/ActionList.js +163 -0
  4. package/dist/components/Box.d.ts +19 -0
  5. package/dist/components/Box.d.ts.map +1 -0
  6. package/dist/components/Box.js +15 -0
  7. package/dist/components/Button.d.ts +12 -0
  8. package/dist/components/Button.d.ts.map +1 -0
  9. package/dist/components/Button.js +112 -0
  10. package/dist/components/Button.stories.d.ts +8 -0
  11. package/dist/components/Button.stories.d.ts.map +1 -0
  12. package/dist/components/Dialog.d.ts +30 -0
  13. package/dist/components/Dialog.d.ts.map +1 -0
  14. package/dist/components/Dialog.js +90 -0
  15. package/dist/components/Flash.d.ts +8 -0
  16. package/dist/components/Flash.d.ts.map +1 -0
  17. package/dist/components/Flash.js +12 -0
  18. package/dist/components/Heading.d.ts +8 -0
  19. package/dist/components/Heading.d.ts.map +1 -0
  20. package/dist/components/Heading.js +12 -0
  21. package/dist/components/IconButton.d.ts +10 -0
  22. package/dist/components/IconButton.d.ts.map +1 -0
  23. package/dist/components/IconButton.js +40 -0
  24. package/dist/components/Label.d.ts +9 -0
  25. package/dist/components/Label.d.ts.map +1 -0
  26. package/dist/components/Label.js +26 -0
  27. package/dist/components/Link.d.ts +7 -0
  28. package/dist/components/Link.d.ts.map +1 -0
  29. package/dist/components/Link.js +26 -0
  30. package/dist/components/Spinner.d.ts +5 -0
  31. package/dist/components/Spinner.d.ts.map +1 -0
  32. package/dist/components/Spinner.js +12 -0
  33. package/dist/components/Text.d.ts +15 -0
  34. package/dist/components/Text.d.ts.map +1 -0
  35. package/dist/components/Text.js +26 -0
  36. package/dist/components/TextInput.d.ts +15 -0
  37. package/dist/components/TextInput.d.ts.map +1 -0
  38. package/dist/components/TextInput.js +38 -0
  39. package/dist/components/ToggleSwitch.d.ts +6 -0
  40. package/dist/components/ToggleSwitch.d.ts.map +1 -0
  41. package/dist/components/ToggleSwitch.js +14 -0
  42. package/dist/components/UnderlineNav.d.ts +11 -0
  43. package/dist/components/UnderlineNav.d.ts.map +1 -0
  44. package/dist/components/UnderlineNav.js +45 -0
  45. package/dist/components/deprecated/ActionList.d.ts +23 -0
  46. package/dist/components/deprecated/ActionList.d.ts.map +1 -0
  47. package/dist/components/deprecated/ActionList.js +49 -0
  48. package/dist/components/deprecated/DialogV1.d.ts +11 -0
  49. package/dist/components/deprecated/DialogV1.d.ts.map +1 -0
  50. package/dist/components/deprecated/DialogV1.js +44 -0
  51. package/dist/components/deprecated/Octicon.d.ts +17 -0
  52. package/dist/components/deprecated/Octicon.d.ts.map +1 -0
  53. package/dist/components/deprecated/Octicon.js +39 -0
  54. package/dist/components.json +40 -2
  55. package/dist/deprecated.d.ts +49 -0
  56. package/dist/deprecated.d.ts.map +1 -0
  57. package/dist/deprecated.js +3 -0
  58. package/dist/experimental.d.ts +12 -0
  59. package/dist/experimental.d.ts.map +1 -0
  60. package/dist/experimental.js +1 -0
  61. package/dist/index.d.ts +189 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +14 -0
  64. package/package.json +11 -3
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { ActionList as PrimerActionList, type ActionListProps as PrimerActionListProps, type ActionListItemProps as PrimerActionListItemProps, type ActionListLinkItemProps as PrimerActionListLinkItemProps, type ActionListGroupProps as PrimerActionListGroupProps, type ActionListDividerProps as PrimerActionListDividerProps, type ActionListLeadingVisualProps as PrimerActionListLeadingVisualProps, type ActionListTrailingVisualProps as PrimerActionListTrailingVisualProps, type SlotMarker } from '@primer/react';
3
+ import { type SxProp } from '../sx';
4
+ import type { ForwardRefComponent } from '../polymorphic';
5
+ type PrimerActionListTrailingActionProps = React.ComponentProps<typeof PrimerActionList.TrailingAction>;
6
+ export type ActionListProps<As extends React.ElementType = 'ul'> = PrimerActionListProps<As> & SxProp;
7
+ export type ActionListItemProps = React.PropsWithChildren<PrimerActionListItemProps & 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
+ };
14
+ export type ActionListDividerProps = React.PropsWithChildren<PrimerActionListDividerProps & 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
+ };
21
+ export type ActionListTrailingActionProps = React.PropsWithChildren<PrimerActionListTrailingActionProps & SxProp>;
22
+ declare const ActionListImpl: React.ForwardRefExoticComponent<Omit<ActionListProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
23
+ declare const ActionListLinkItem: ForwardRefComponent<"a", ActionListLinkItemProps> & SlotMarker;
24
+ type TrailingActionElements = 'button' | 'a';
25
+ declare const ActionListTrailingAction: ForwardRefComponent<TrailingActionElements, ActionListTrailingActionProps> & SlotMarker;
26
+ declare const ActionListItem: ForwardRefComponent<"li", ActionListItemProps> & SlotMarker;
27
+ declare const ActionListGroup: React.ComponentType<ActionListGroupProps> & SlotMarker;
28
+ declare const ActionListDivider: React.ComponentType<ActionListDividerProps> & SlotMarker;
29
+ declare const ActionListLeadingVisual: React.ComponentType<ActionListLeadingVisualProps> & SlotMarker;
30
+ declare const ActionListTrailingVisual: React.ComponentType<ActionListTrailingVisualProps> & SlotMarker;
31
+ export declare const ActionList: typeof ActionListImpl & {
32
+ Item: typeof ActionListItem;
33
+ LinkItem: typeof ActionListLinkItem;
34
+ Group: typeof ActionListGroup;
35
+ GroupHeading: typeof PrimerActionList.GroupHeading;
36
+ Divider: typeof ActionListDivider;
37
+ Description: typeof PrimerActionList.Description;
38
+ LeadingVisual: typeof ActionListLeadingVisual;
39
+ TrailingVisual: typeof ActionListTrailingVisual;
40
+ Heading: typeof PrimerActionList.Heading;
41
+ TrailingAction: typeof ActionListTrailingAction;
42
+ } & SlotMarker;
43
+ export {};
44
+ //# sourceMappingURL=ActionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionList.d.ts","sourceRoot":"","sources":["../../src/components/ActionList.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,163 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { ActionList as ActionList$1 } from '@primer/react';
4
+ import { sx } from '../sx.js';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ const StyledActionList = styled(ActionList$1).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "ActionList__StyledActionList",
11
+ componentId: "sc-hw2362-0"
12
+ })(["", ""], sx);
13
+ const ActionListImpl = /*#__PURE__*/React.forwardRef(function ActionListImpl({
14
+ as,
15
+ ...rest
16
+ }, ref) {
17
+ return /*#__PURE__*/jsx(StyledActionList, {
18
+ ref: ref,
19
+ ...rest,
20
+ ...(as ? {
21
+ forwardedAs: as
22
+ } : {})
23
+ });
24
+ });
25
+ const StyledActionListLinkItem = styled(ActionList$1.LinkItem).withConfig({
26
+ shouldForwardProp: prop => prop !== 'sx'
27
+ }).withConfig({
28
+ displayName: "ActionList__StyledActionListLinkItem",
29
+ componentId: "sc-hw2362-1"
30
+ })(["", ""], sx);
31
+ const ActionListLinkItem = /*#__PURE__*/React.forwardRef(({
32
+ children,
33
+ as,
34
+ ...props
35
+ }, ref) => /*#__PURE__*/jsx(StyledActionListLinkItem, {
36
+ ref: ref,
37
+ ...props,
38
+ ...(as ? {
39
+ forwardedAs: as
40
+ } : {}),
41
+ children: children
42
+ }));
43
+ ActionListLinkItem.displayName = 'ActionList.LinkItem';
44
+ const StyledActionListTrailingAction = styled(ActionList$1.TrailingAction).withConfig({
45
+ shouldForwardProp: prop => prop !== 'sx'
46
+ }).withConfig({
47
+ displayName: "ActionList__StyledActionListTrailingAction",
48
+ componentId: "sc-hw2362-2"
49
+ })(["", ""], sx);
50
+ const ActionListTrailingAction = /*#__PURE__*/React.forwardRef((props, ref) => {
51
+ const {
52
+ as,
53
+ ...rest
54
+ } = props;
55
+ return /*#__PURE__*/jsx(StyledActionListTrailingAction, {
56
+ ...rest,
57
+ ...(as ? {
58
+ forwardedAs: as
59
+ } : {}),
60
+ ref: ref
61
+ });
62
+ });
63
+ const StyledActionListItem = styled(ActionList$1.Item).withConfig({
64
+ shouldForwardProp: prop => prop !== 'sx'
65
+ }).withConfig({
66
+ displayName: "ActionList__StyledActionListItem",
67
+ componentId: "sc-hw2362-3"
68
+ })(["", ""], sx);
69
+ const ActionListItem = /*#__PURE__*/React.forwardRef(({
70
+ children,
71
+ as,
72
+ ...props
73
+ }, ref) => /*#__PURE__*/jsx(StyledActionListItem, {
74
+ ref: ref,
75
+ ...props,
76
+ ...(as ? {
77
+ forwardedAs: as
78
+ } : {}),
79
+ children: children
80
+ }));
81
+ const StyledActionListGroup = styled(ActionList$1.Group).withConfig({
82
+ shouldForwardProp: prop => prop !== 'sx'
83
+ }).withConfig({
84
+ displayName: "ActionList__StyledActionListGroup",
85
+ componentId: "sc-hw2362-4"
86
+ })(["", ""], sx);
87
+ const ActionListGroup = ({
88
+ children,
89
+ as,
90
+ ...props
91
+ }) => /*#__PURE__*/jsx(StyledActionListGroup, {
92
+ ...props,
93
+ ...(as ? {
94
+ forwardedAs: as
95
+ } : {}),
96
+ children: children
97
+ });
98
+ ActionListGroup.displayName = 'ActionList.Group';
99
+ const ActionListDivider = styled(ActionList$1.Divider).withConfig({
100
+ shouldForwardProp: prop => prop !== 'sx'
101
+ }).withConfig({
102
+ displayName: "ActionList__ActionListDivider",
103
+ componentId: "sc-hw2362-5"
104
+ })(["", ""], sx);
105
+ const StyledActionListLeadingVisual = styled(ActionList$1.LeadingVisual).withConfig({
106
+ shouldForwardProp: prop => prop !== 'sx'
107
+ }).withConfig({
108
+ displayName: "ActionList__StyledActionListLeadingVisual",
109
+ componentId: "sc-hw2362-6"
110
+ })(["", ""], sx);
111
+ const ActionListLeadingVisual = ({
112
+ children,
113
+ as,
114
+ ...props
115
+ }) => /*#__PURE__*/jsx(StyledActionListLeadingVisual, {
116
+ ...props,
117
+ ...(as ? {
118
+ forwardedAs: as
119
+ } : {}),
120
+ children: children
121
+ });
122
+ ActionListLeadingVisual.displayName = 'ActionList.LeadingVisual';
123
+ const StyledActionListTrailingVisual = styled(ActionList$1.TrailingVisual).withConfig({
124
+ shouldForwardProp: prop => prop !== 'sx'
125
+ }).withConfig({
126
+ displayName: "ActionList__StyledActionListTrailingVisual",
127
+ componentId: "sc-hw2362-7"
128
+ })(["", ""], sx);
129
+ const ActionListTrailingVisual = ({
130
+ children,
131
+ as,
132
+ ...props
133
+ }) => /*#__PURE__*/jsx(StyledActionListTrailingVisual, {
134
+ ...props,
135
+ ...(as ? {
136
+ forwardedAs: as
137
+ } : {}),
138
+ children: children
139
+ });
140
+ ActionListTrailingVisual.displayName = 'ActionList.TrailingVisual';
141
+ const ActionList = Object.assign(ActionListImpl, {
142
+ Item: ActionListItem,
143
+ LinkItem: ActionListLinkItem,
144
+ Group: ActionListGroup,
145
+ GroupHeading: ActionList$1.GroupHeading,
146
+ Divider: ActionListDivider,
147
+ Description: ActionList$1.Description,
148
+ LeadingVisual: ActionListLeadingVisual,
149
+ TrailingVisual: ActionListTrailingVisual,
150
+ Heading: ActionList$1.Heading,
151
+ TrailingAction: ActionListTrailingAction
152
+ });
153
+
154
+ // Assign slot markers after component definitions
155
+ ActionListItem.__SLOT__ = ActionList$1.Item.__SLOT__;
156
+ ActionListLinkItem.__SLOT__ = ActionList$1.LinkItem.__SLOT__;
157
+ ActionListGroup.__SLOT__ = ActionList$1.Group.__SLOT__;
158
+ ActionListDivider.__SLOT__ = ActionList$1.Divider.__SLOT__;
159
+ ActionListLeadingVisual.__SLOT__ = ActionList$1.LeadingVisual.__SLOT__;
160
+ ActionListTrailingVisual.__SLOT__ = ActionList$1.TrailingVisual.__SLOT__;
161
+ ActionListTrailingAction.__SLOT__ = ActionList$1.TrailingAction.__SLOT__;
162
+
163
+ export { ActionList };
@@ -0,0 +1,19 @@
1
+ import type { BackgroundProps, BorderProps, ColorProps, FlexboxProps, GridProps, LayoutProps, PositionProps, ShadowProps, SpaceProps, TypographyProps } from 'styled-system';
2
+ import type { SxProp } from '../sx';
3
+ type ComponentProps<T> = T extends React.ComponentType<React.PropsWithChildren<infer Props>> ? (Props extends object ? Props : never) : never;
4
+ type StyledBoxProps = SxProp & SpaceProps & ColorProps & TypographyProps & LayoutProps & FlexboxProps & GridProps & BackgroundProps & BorderProps & PositionProps & ShadowProps;
5
+ /**
6
+ * @deprecated The Box component is deprecated. Replace with a `div` or
7
+ * appropriate HTML element instead, with CSS modules for styling.
8
+ * @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
9
+ */
10
+ declare const Box: import("styled-components").StyledComponent<"div", any, StyledBoxProps, never>;
11
+ /**
12
+ * @deprecated The Box component is deprecated. Replace with a `div` or
13
+ * appropriate HTML element instead, with CSS modules for styling.
14
+ * @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
15
+ */
16
+ export type BoxProps = ComponentProps<typeof Box>;
17
+ export default Box;
18
+ export { Box };
19
+ //# sourceMappingURL=Box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../src/components/Box.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AAGjC,KAAK,cAAc,CAAC,CAAC,IACnB,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,SAAS,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAA;AAEtH,KAAK,cAAc,GAAG,MAAM,GAC1B,UAAU,GACV,UAAU,GACV,eAAe,GACf,WAAW,GACX,YAAY,GACZ,SAAS,GACT,eAAe,GACf,WAAW,GACX,aAAa,GACb,WAAW,CAAA;AAEb;;;;GAIG;AACH,QAAA,MAAM,GAAG,gFAYR,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,GAAG,CAAC,CAAA;AACjD,eAAe,GAAG,CAAA;AAClB,OAAO,EAAC,GAAG,EAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import styled from 'styled-components';
2
+ import { space, color, typography, layout, flexbox, grid, background, border, position, shadow } from 'styled-system';
3
+ import { sx } from '../sx.js';
4
+
5
+ /**
6
+ * @deprecated The Box component is deprecated. Replace with a `div` or
7
+ * appropriate HTML element instead, with CSS modules for styling.
8
+ * @see https://github.com/primer/react/blob/main/contributor-docs/migration-from-box.md
9
+ */
10
+ const Box = styled.div.withConfig({
11
+ displayName: "Box",
12
+ componentId: "sc-62in7e-0"
13
+ })(space, color, typography, layout, flexbox, grid, background, border, position, shadow, sx);
14
+
15
+ export { Box };
@@ -0,0 +1,12 @@
1
+ import { type ButtonProps as PrimerButtonProps, type SlotMarker } from '@primer/react';
2
+ import type { SxProp, BetterSystemStyleObject } from '../sx';
3
+ import type { ForwardRefComponent } from '../polymorphic';
4
+ type ButtonComponentProps = PrimerButtonProps & SxProp & {
5
+ as?: React.ElementType;
6
+ };
7
+ declare const ButtonComponent: ForwardRefComponent<"button", ButtonComponentProps> & SlotMarker;
8
+ export declare function generateCustomSxProp(props: Partial<Pick<PrimerButtonProps, 'size' | 'block' | 'leadingVisual' | 'trailingVisual' | 'trailingAction'>>, providedSx: BetterSystemStyleObject): {
9
+ [key: string]: BetterSystemStyleObject;
10
+ };
11
+ export { ButtonComponent, type ButtonComponentProps };
12
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,IAAI,iBAAiB,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAA;AAC5G,OAAO,KAAK,EAAC,MAAM,EAAuB,uBAAuB,EAAC,MAAM,OAAO,CAAA;AAE/E,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAIvD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQjF,QAAA,MAAM,eAAe,EAgBf,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,UAAU,CAAA;AA0CtE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,EACjH,UAAU,EAAE,uBAAuB;;EAmBpC;AAKD,OAAO,EAAC,eAAe,EAAE,KAAK,oBAAoB,EAAC,CAAA"}
@@ -0,0 +1,112 @@
1
+ import { Button } from '@primer/react';
2
+ import { forwardRef } from 'react';
3
+ import styled from 'styled-components';
4
+ import { sx } from '../sx.js';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ const StyledButtonComponent = styled(Button).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "Button__StyledButtonComponent",
11
+ componentId: "sc-vqy3e4-0"
12
+ })(["", ""], sx);
13
+ const ButtonComponent = /*#__PURE__*/forwardRef(({
14
+ as,
15
+ sx,
16
+ style: propStyle,
17
+ ...props
18
+ }, ref) => {
19
+ const {
20
+ block,
21
+ size = 'medium',
22
+ leadingVisual,
23
+ trailingVisual,
24
+ trailingAction
25
+ } = props;
26
+ let sxStyles = {};
27
+ const style = {
28
+ ...(propStyle || {})
29
+ };
30
+ if (sx !== null && Object.keys(sx || {}).length > 0) {
31
+ sxStyles = generateCustomSxProp({
32
+ block,
33
+ size,
34
+ leadingVisual,
35
+ trailingVisual,
36
+ trailingAction
37
+ }, sx);
38
+ const {
39
+ color
40
+ } = sx;
41
+ if (color) style['--button-color'] = color;
42
+ }
43
+ return /*#__PURE__*/jsx(StyledButtonComponent, {
44
+ style: style,
45
+ sx: sxStyles,
46
+ ref: ref,
47
+ ...props,
48
+ ...(as ? {
49
+ forwardedAs: as
50
+ } : {})
51
+ });
52
+ });
53
+
54
+ // This function is used to generate a custom cssSelector for the sxProp
55
+
56
+ // The usual sx prop can like this:
57
+ // sx={{
58
+ // [`@media (max-width: 768px)`]: {
59
+ // '& > ul': {
60
+ // backgroundColor: 'deeppink',
61
+ // },
62
+ // '&:hover': {
63
+ // backgroundColor: 'yellow',
64
+ // },
65
+ // },
66
+ // '&:hover': {
67
+ // backgroundColor: 'yellow',
68
+ // },
69
+ // '&': {
70
+ // width : 320px
71
+ // }
72
+ // }}
73
+ //*
74
+ /* What we want for Button styles is this:
75
+ sx={{
76
+ // [`@media (max-width: 768px)`]: {
77
+ // '&[data-attribute="something"] > ul': {
78
+ // backgroundColor: 'deeppink',
79
+ // },
80
+ // '&[data-attribute="something"]:hover': {
81
+ // backgroundColor: 'yellow',
82
+ // },
83
+ // },
84
+ // '&[data-attribute="something"]:hover': {
85
+ // backgroundColor: 'yellow',
86
+ // },
87
+ // '&[data-attribute="something"]': {
88
+ // width : 320px
89
+ // }
90
+ // }}
91
+
92
+ // We need to make sure we append the customCSSSelector to the original class selector. i.e & - > &[data-attribute="Icon"][data-size="small"]
93
+ */
94
+ function generateCustomSxProp(props, providedSx) {
95
+ // Possible data attributes: data-size, data-block, data-no-visuals
96
+ const size = `[data-size="${props.size}"]`;
97
+ const block = props.block ? `[data-block="block"]` : '';
98
+ const noVisuals = props.leadingVisual || props.trailingVisual || props.trailingAction ? '' : '[data-no-visuals]';
99
+
100
+ // this is a custom selector. We need to make sure we add the data attributes to the base css class (& -> &[data-attributename="value"]])
101
+ const cssSelector = `&${size}${block}${noVisuals}`; // &[data-size="small"][data-block="block"][data-no-visuals]
102
+
103
+ const customSxProp = {};
104
+ if (!providedSx) return customSxProp;else {
105
+ customSxProp[cssSelector] = providedSx;
106
+ return customSxProp;
107
+ }
108
+ }
109
+ ButtonComponent.displayName = 'Button';
110
+ ButtonComponent.__SLOT__ = Button.__SLOT__;
111
+
112
+ export { ButtonComponent, generateCustomSxProp };
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: import("../polymorphic").ForwardRefComponent<"button", import("./Button").ButtonComponentProps> & import("@primer/react").SlotMarker;
4
+ };
5
+ export default _default;
6
+ export declare const WithColor: () => import("react").JSX.Element;
7
+ export declare const WithFontSize: () => import("react").JSX.Element;
8
+ //# sourceMappingURL=Button.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../src/components/Button.stories.tsx"],"names":[],"mappings":";;;;AAEA,wBAGC;AAED,eAAO,MAAM,SAAS,mCAAgE,CAAA;AAEtF,eAAO,MAAM,YAAY,mCAA0D,CAAA"}
@@ -0,0 +1,30 @@
1
+ import type { DialogProps as PrimerDialogProps } from '@primer/react';
2
+ import type { SxProp } from '../sx';
3
+ import { type PropsWithChildren } from 'react';
4
+ type DialogProps = PropsWithChildren<PrimerDialogProps> & SxProp & {
5
+ as?: React.ElementType;
6
+ };
7
+ type StyledBodyProps = React.ComponentProps<'div'> & SxProp & {
8
+ as?: React.ElementType;
9
+ };
10
+ type StyledFooterProps = React.ComponentProps<'div'> & SxProp & {
11
+ as?: React.ElementType;
12
+ };
13
+ declare const Dialog: import("react").ForwardRefExoticComponent<PrimerDialogProps & {
14
+ children?: import("react").ReactNode | undefined;
15
+ } & SxProp & {
16
+ as?: React.ElementType;
17
+ } & import("react").RefAttributes<HTMLDivElement>> & {
18
+ __SLOT__: symbol;
19
+ Buttons: import("react").FC<PropsWithChildren<{
20
+ buttons: import("@primer/react").DialogButtonProps[];
21
+ }>>;
22
+ Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SxProp & {
23
+ as?: React.ElementType;
24
+ } & import("react").RefAttributes<HTMLDivElement>>;
25
+ Body: import("react").ForwardRefExoticComponent<Omit<StyledBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
26
+ Footer: import("react").ForwardRefExoticComponent<Omit<StyledFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
27
+ };
28
+ export { Dialog };
29
+ export type { DialogProps };
30
+ //# sourceMappingURL=Dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,IAAI,iBAAiB,EAAa,MAAM,eAAe,CAAA;AAC/E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AAGjC,OAAO,EAA4C,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAEvF,KAAK,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAwB3F,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAYtF,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAgBxF,QAAA,MAAM,MAAM;;;SApD6D,KAAK,CAAC,WAAW;;;;;;;aAYhB,KAAK,CAAC,WAAW;;;;CA8CzF,CAAA;AAEF,OAAO,EAAC,MAAM,EAAC,CAAA;AACf,YAAY,EAAC,WAAW,EAAC,CAAA"}
@@ -0,0 +1,90 @@
1
+ import { Dialog as Dialog$1 } from '@primer/react';
2
+ import { sx } from '../sx.js';
3
+ import styled from 'styled-components';
4
+ import { forwardRef } from 'react';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ const StyledDialog = styled(Dialog$1).withConfig({
8
+ shouldForwardProp: prop => prop !== 'sx'
9
+ }).withConfig({
10
+ displayName: "Dialog__StyledDialog",
11
+ componentId: "sc-19zph8h-0"
12
+ })(["", ""], sx);
13
+ const DialogImpl = /*#__PURE__*/forwardRef(function Dialog({
14
+ as,
15
+ ...props
16
+ }, ref) {
17
+ return /*#__PURE__*/jsx(StyledDialog, {
18
+ ref: ref,
19
+ ...(as ? {
20
+ forwardedAs: as
21
+ } : {}),
22
+ ...props
23
+ });
24
+ });
25
+ const StyledDialogHeader = styled(Dialog$1.Header).withConfig({
26
+ shouldForwardProp: prop => prop !== 'sx'
27
+ }).withConfig({
28
+ displayName: "Dialog__StyledDialogHeader",
29
+ componentId: "sc-19zph8h-1"
30
+ })(["", ""], sx);
31
+ const DialogHeader = /*#__PURE__*/forwardRef(function DialogHeader({
32
+ as,
33
+ ...props
34
+ }, ref) {
35
+ return /*#__PURE__*/jsx(StyledDialogHeader, {
36
+ ref: ref,
37
+ ...(as ? {
38
+ forwardedAs: as
39
+ } : {}),
40
+ ...props
41
+ });
42
+ });
43
+ const StyledDialogBody = styled(Dialog$1.Body).withConfig({
44
+ shouldForwardProp: prop => prop !== 'sx'
45
+ }).withConfig({
46
+ displayName: "Dialog__StyledDialogBody",
47
+ componentId: "sc-19zph8h-2"
48
+ })(["", ""], sx);
49
+ const DialogBody = /*#__PURE__*/forwardRef(function DialogBody({
50
+ as,
51
+ ...props
52
+ }, ref) {
53
+ return /*#__PURE__*/jsx(StyledDialogBody, {
54
+ ref: ref,
55
+ ...(as ? {
56
+ forwardedAs: as
57
+ } : {}),
58
+ ...props
59
+ });
60
+ });
61
+ const StyledDialogFooter = styled(Dialog$1.Footer).withConfig({
62
+ shouldForwardProp: prop => prop !== 'sx'
63
+ }).withConfig({
64
+ displayName: "Dialog__StyledDialogFooter",
65
+ componentId: "sc-19zph8h-3"
66
+ })(["", ""], sx);
67
+ const DialogFooter = /*#__PURE__*/forwardRef(function DialogFooter({
68
+ as,
69
+ ...props
70
+ }, ref) {
71
+ return /*#__PURE__*/jsx(StyledDialogFooter, {
72
+ ref: ref,
73
+ ...(as ? {
74
+ forwardedAs: as
75
+ } : {}),
76
+ ...props
77
+ });
78
+ });
79
+ DialogHeader.__SLOT__ = Dialog$1.Header.__SLOT__;
80
+ DialogBody.__SLOT__ = Dialog$1.Body.__SLOT__;
81
+ DialogFooter.__SLOT__ = Dialog$1.Footer.__SLOT__;
82
+ const Dialog = Object.assign(DialogImpl, {
83
+ __SLOT__: Dialog$1['__SLOT__'],
84
+ Buttons: Dialog$1.Buttons,
85
+ Header: DialogHeader,
86
+ Body: DialogBody,
87
+ Footer: DialogFooter
88
+ });
89
+
90
+ export { Dialog };
@@ -0,0 +1,8 @@
1
+ import { type FlashProps as PrimerFlashProps } from '@primer/react';
2
+ import { type SxProp } from '../sx';
3
+ import type { ForwardRefComponent } from '../polymorphic';
4
+ type FlashProps = PrimerFlashProps & SxProp;
5
+ declare const Flash: ForwardRefComponent<'div', FlashProps>;
6
+ export { Flash };
7
+ export type { FlashProps };
8
+ //# sourceMappingURL=Flash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flash.d.ts","sourceRoot":"","sources":["../../src/components/Flash.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,UAAU,IAAI,gBAAgB,EAAuB,MAAM,eAAe,CAAA;AAEvF,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAEvD,KAAK,UAAU,GAAG,gBAAgB,GAAG,MAAM,CAAA;AAE3C,QAAA,MAAM,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAIjD,CAAA;AAED,OAAO,EAAC,KAAK,EAAC,CAAA;AACd,YAAY,EAAC,UAAU,EAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Flash as Flash$1 } from '@primer/react';
2
+ import styled from 'styled-components';
3
+ import { sx } from '../sx.js';
4
+
5
+ const Flash = styled(Flash$1).withConfig({
6
+ shouldForwardProp: prop => prop !== 'sx'
7
+ }).withConfig({
8
+ displayName: "Flash",
9
+ componentId: "sc-413izo-0"
10
+ })(["", ""], sx);
11
+
12
+ export { Flash };
@@ -0,0 +1,8 @@
1
+ import { type HeadingProps as PrimerHeadingProps } from '@primer/react';
2
+ import type { ForwardRefComponent } from '../polymorphic';
3
+ import { type SxProp } from '../sx';
4
+ type HeadingLevels = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
5
+ type HeadingProps = PrimerHeadingProps & SxProp;
6
+ declare const Heading: ForwardRefComponent<HeadingLevels, HeadingProps>;
7
+ export { Heading, type HeadingProps };
8
+ //# sourceMappingURL=Heading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/components/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,eAAe,CAAA;AACrE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAGrC,KAAK,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE5D,KAAK,YAAY,GAAG,kBAAkB,GAAG,MAAM,CAAA;AAE/C,QAAA,MAAM,OAAO,EAAE,mBAAmB,CAAC,aAAa,EAAE,YAAY,CAI7D,CAAA;AAED,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Heading as Heading$1 } from '@primer/react';
2
+ import { sx } from '../sx.js';
3
+ import styled from 'styled-components';
4
+
5
+ const Heading = styled(Heading$1).withConfig({
6
+ shouldForwardProp: prop => prop !== 'sx'
7
+ }).withConfig({
8
+ displayName: "Heading",
9
+ componentId: "sc-1vc165i-0"
10
+ })(["", ""], sx);
11
+
12
+ export { Heading };
@@ -0,0 +1,10 @@
1
+ import { type IconButtonProps as PrimerIconButtonProps, type SlotMarker } from '@primer/react';
2
+ import { type ForwardRefComponent } from '../polymorphic';
3
+ import { type SxProp } from '../sx';
4
+ type IconButtonProps = PrimerIconButtonProps & SxProp & {
5
+ as?: React.ElementType;
6
+ };
7
+ declare const IconButton: ForwardRefComponent<"a" | "button", IconButtonProps> & SlotMarker;
8
+ export { IconButton };
9
+ export type { IconButtonProps };
10
+ //# sourceMappingURL=IconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,UAAU,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAC,KAAK,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAIvD,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,KAAK,eAAe,GAAG,qBAAqB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQhF,QAAA,MAAM,UAAU,EAUV,mBAAmB,CAAC,GAAG,GAAG,QAAQ,EAAE,eAAe,CAAC,GAAG,UAAU,CAAA;AAIvE,OAAO,EAAC,UAAU,EAAC,CAAA;AACnB,YAAY,EAAC,eAAe,EAAC,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { IconButton as IconButton$1 } from '@primer/react';
2
+ import { generateCustomSxProp } from './Button.js';
3
+ import { forwardRef } from 'react';
4
+ import styled from 'styled-components';
5
+ import { sx } from '../sx.js';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ const StyledIconButton = styled(IconButton$1).withConfig({
9
+ shouldForwardProp: prop => prop !== 'sx'
10
+ }).withConfig({
11
+ displayName: "IconButton__StyledIconButton",
12
+ componentId: "sc-i53dt6-0"
13
+ })(["", ""], sx);
14
+ const IconButton = /*#__PURE__*/forwardRef(({
15
+ as,
16
+ sx,
17
+ ...props
18
+ }, ref) => {
19
+ let sxStyles = sx;
20
+ // grap the button props that have associated data attributes in the styles
21
+ const {
22
+ size = 'medium'
23
+ } = props;
24
+ if (sx !== null && sx !== undefined && Object.keys(sx).length > 0) {
25
+ sxStyles = generateCustomSxProp({
26
+ size
27
+ }, sx);
28
+ }
29
+ return /*#__PURE__*/jsx(StyledIconButton, {
30
+ sx: sxStyles,
31
+ ...props,
32
+ ...(as ? {
33
+ forwardedAs: as
34
+ } : {}),
35
+ ref: ref
36
+ });
37
+ });
38
+ IconButton.__SLOT__ = IconButton$1.__SLOT__;
39
+
40
+ export { IconButton };
@@ -0,0 +1,9 @@
1
+ import { type LabelProps as PrimerLabelProps } from '@primer/react';
2
+ import { type SxProp } from '../sx';
3
+ import type { ForwardRefComponent } from '../polymorphic';
4
+ type LabelProps = PrimerLabelProps & SxProp & {
5
+ as?: React.ElementType;
6
+ };
7
+ declare const Label: ForwardRefComponent<"span", LabelProps>;
8
+ export { Label, type LabelProps };
9
+ //# sourceMappingURL=Label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../src/components/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,UAAU,IAAI,gBAAgB,EAAuB,MAAM,eAAe,CAAA;AACvF,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAGvD,KAAK,UAAU,GAAG,gBAAgB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQtE,QAAA,MAAM,KAAK,EAEL,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AAE7C,OAAO,EAAC,KAAK,EAAE,KAAK,UAAU,EAAC,CAAA"}