@primer/components 0.0.0-2021104155729 → 0.0.0-202110417386
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 +1 -3
- package/dist/browser.esm.js +472 -472
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +102 -102
- package/dist/browser.umd.js.map +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +26 -26
- package/lib/Autocomplete/AutocompleteInput.d.ts +26 -26
- package/lib/Button/Button.d.ts +24 -24
- package/lib/Button/ButtonClose.d.ts +43 -43
- package/lib/Button/ButtonDanger.d.ts +24 -24
- package/lib/Button/ButtonInvisible.d.ts +24 -24
- package/lib/Button/ButtonOutline.d.ts +24 -24
- package/lib/Button/ButtonPrimary.d.ts +24 -24
- package/lib/CircleOcticon.d.ts +40 -40
- package/lib/Dialog.d.ts +43 -43
- package/lib/Dropdown.d.ts +168 -168
- package/lib/DropdownMenu/DropdownButton.d.ts +44 -44
- package/lib/FilterList.d.ts +40 -40
- package/lib/NewLabel/NewLabel.d.ts +11 -0
- package/lib/NewLabel/NewLabel.js +134 -0
- package/lib/NewLabel/NewStateLabel.d.ts +10 -0
- package/lib/NewLabel/NewStateLabel.js +49 -0
- package/lib/NewLabel/_newLabelStyleUtils.d.ts +3 -0
- package/lib/NewLabel/_newLabelStyleUtils.js +40 -0
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +235 -235
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/TextInputWithTokens.d.ts +26 -26
- package/lib/Timeline.d.ts +41 -41
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/sx.d.ts +0 -2
- package/lib/sx.js +0 -8
- package/lib/theme-preval.js +2 -81
- package/lib/utils/testing.d.ts +1 -14
- package/lib-esm/Autocomplete/Autocomplete.d.ts +26 -26
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +26 -26
- package/lib-esm/Button/Button.d.ts +24 -24
- package/lib-esm/Button/ButtonClose.d.ts +43 -43
- package/lib-esm/Button/ButtonDanger.d.ts +24 -24
- package/lib-esm/Button/ButtonInvisible.d.ts +24 -24
- package/lib-esm/Button/ButtonOutline.d.ts +24 -24
- package/lib-esm/Button/ButtonPrimary.d.ts +24 -24
- package/lib-esm/CircleOcticon.d.ts +40 -40
- package/lib-esm/Dialog.d.ts +43 -43
- package/lib-esm/Dropdown.d.ts +168 -168
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +44 -44
- package/lib-esm/FilterList.d.ts +40 -40
- package/lib-esm/NewLabel/NewLabel.d.ts +11 -0
- package/lib-esm/NewLabel/NewLabel.js +115 -0
- package/lib-esm/NewLabel/NewStateLabel.d.ts +10 -0
- package/lib-esm/NewLabel/NewStateLabel.js +36 -0
- package/lib-esm/NewLabel/_newLabelStyleUtils.d.ts +3 -0
- package/lib-esm/NewLabel/_newLabelStyleUtils.js +30 -0
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +235 -235
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +26 -26
- package/lib-esm/Timeline.d.ts +41 -41
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/sx.d.ts +0 -2
- package/lib-esm/sx.js +1 -3
- package/lib-esm/theme-preval.js +2 -81
- package/lib-esm/utils/testing.d.ts +1 -14
- package/package.json +2 -4
- package/lib/ActionList2/Description.d.ts +0 -12
- package/lib/ActionList2/Description.js +0 -53
- package/lib/ActionList2/Divider.d.ts +0 -5
- package/lib/ActionList2/Divider.js +0 -35
- package/lib/ActionList2/Group.d.ts +0 -11
- package/lib/ActionList2/Group.js +0 -57
- package/lib/ActionList2/Header.d.ts +0 -26
- package/lib/ActionList2/Header.js +0 -55
- package/lib/ActionList2/Item.d.ts +0 -71
- package/lib/ActionList2/Item.js +0 -223
- package/lib/ActionList2/LinkItem.d.ts +0 -17
- package/lib/ActionList2/LinkItem.js +0 -57
- package/lib/ActionList2/List.d.ts +0 -26
- package/lib/ActionList2/List.js +0 -51
- package/lib/ActionList2/Selection.d.ts +0 -5
- package/lib/ActionList2/Selection.js +0 -70
- package/lib/ActionList2/Visuals.d.ts +0 -11
- package/lib/ActionList2/Visuals.js +0 -90
- package/lib/ActionList2/index.d.ts +0 -40
- package/lib/ActionList2/index.js +0 -47
- package/lib/experiments.d.ts +0 -1
- package/lib/experiments.js +0 -18
- package/lib/utils/create-slots.d.ts +0 -17
- package/lib/utils/create-slots.js +0 -105
- package/lib/utils/use-force-update.d.ts +0 -1
- package/lib/utils/use-force-update.js +0 -19
- package/lib-esm/ActionList2/Description.d.ts +0 -12
- package/lib-esm/ActionList2/Description.js +0 -37
- package/lib-esm/ActionList2/Divider.d.ts +0 -5
- package/lib-esm/ActionList2/Divider.js +0 -23
- package/lib-esm/ActionList2/Group.d.ts +0 -11
- package/lib-esm/ActionList2/Group.js +0 -40
- package/lib-esm/ActionList2/Header.d.ts +0 -26
- package/lib-esm/ActionList2/Header.js +0 -44
- package/lib-esm/ActionList2/Item.d.ts +0 -71
- package/lib-esm/ActionList2/Item.js +0 -197
- package/lib-esm/ActionList2/LinkItem.d.ts +0 -17
- package/lib-esm/ActionList2/LinkItem.js +0 -43
- package/lib-esm/ActionList2/List.d.ts +0 -26
- package/lib-esm/ActionList2/List.js +0 -34
- package/lib-esm/ActionList2/Selection.d.ts +0 -5
- package/lib-esm/ActionList2/Selection.js +0 -52
- package/lib-esm/ActionList2/Visuals.d.ts +0 -11
- package/lib-esm/ActionList2/Visuals.js +0 -68
- package/lib-esm/ActionList2/index.d.ts +0 -40
- package/lib-esm/ActionList2/index.js +0 -33
- package/lib-esm/experiments.d.ts +0 -1
- package/lib-esm/experiments.js +0 -2
- package/lib-esm/utils/create-slots.d.ts +0 -17
- package/lib-esm/utils/create-slots.js +0 -84
- package/lib-esm/utils/use-force-update.d.ts +0 -1
- package/lib-esm/utils/use-force-update.js +0 -6
@@ -37,25 +37,6 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
37
37
|
slot?: string | undefined;
|
38
38
|
style?: React.CSSProperties | undefined;
|
39
39
|
title?: string | undefined;
|
40
|
-
bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
41
|
-
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
42
|
-
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
43
|
-
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
44
|
-
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
45
|
-
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
46
|
-
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
47
|
-
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
48
|
-
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
49
|
-
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
50
|
-
pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
51
|
-
pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
52
|
-
pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
53
|
-
pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
54
|
-
px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
55
|
-
paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
56
|
-
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
57
|
-
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
58
|
-
size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
59
40
|
type?: "button" | "reset" | "submit" | undefined;
|
60
41
|
name?: string | undefined;
|
61
42
|
key?: React.Key | null | undefined;
|
@@ -65,14 +46,14 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
65
46
|
suppressHydrationWarning?: boolean | undefined;
|
66
47
|
accessKey?: string | undefined;
|
67
48
|
className?: string | undefined;
|
68
|
-
contentEditable?: "inherit" | (boolean | "
|
49
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
69
50
|
contextMenu?: string | undefined;
|
70
51
|
dir?: string | undefined;
|
71
|
-
draggable?: (boolean | "
|
52
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
72
53
|
id?: string | undefined;
|
73
54
|
lang?: string | undefined;
|
74
55
|
placeholder?: string | undefined;
|
75
|
-
spellCheck?: (boolean | "
|
56
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
76
57
|
tabIndex?: number | undefined;
|
77
58
|
radioGroup?: string | undefined;
|
78
59
|
role?: React.AriaRole | undefined;
|
@@ -98,47 +79,47 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
98
79
|
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
99
80
|
is?: string | undefined;
|
100
81
|
'aria-activedescendant'?: string | undefined;
|
101
|
-
'aria-atomic'?: boolean | "
|
102
|
-
'aria-autocomplete'?: "none" | "
|
103
|
-
'aria-busy'?: boolean | "
|
104
|
-
'aria-checked'?: boolean | "
|
82
|
+
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
83
|
+
'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
|
84
|
+
'aria-busy'?: boolean | "true" | "false" | undefined;
|
85
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
105
86
|
'aria-colcount'?: number | undefined;
|
106
87
|
'aria-colindex'?: number | undefined;
|
107
88
|
'aria-colspan'?: number | undefined;
|
108
89
|
'aria-controls'?: string | undefined;
|
109
|
-
'aria-current'?: boolean | "time" | "
|
90
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
110
91
|
'aria-describedby'?: string | undefined;
|
111
92
|
'aria-details'?: string | undefined;
|
112
|
-
'aria-disabled'?: boolean | "
|
113
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
93
|
+
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
94
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
114
95
|
'aria-errormessage'?: string | undefined;
|
115
|
-
'aria-expanded'?: boolean | "
|
96
|
+
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
116
97
|
'aria-flowto'?: string | undefined;
|
117
|
-
'aria-grabbed'?: boolean | "
|
118
|
-
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "
|
119
|
-
'aria-hidden'?: boolean | "
|
120
|
-
'aria-invalid'?: boolean | "
|
98
|
+
'aria-grabbed'?: boolean | "true" | "false" | undefined;
|
99
|
+
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
|
100
|
+
'aria-hidden'?: boolean | "true" | "false" | undefined;
|
101
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
121
102
|
'aria-keyshortcuts'?: string | undefined;
|
122
103
|
'aria-label'?: string | undefined;
|
123
104
|
'aria-labelledby'?: string | undefined;
|
124
105
|
'aria-level'?: number | undefined;
|
125
106
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
126
|
-
'aria-modal'?: boolean | "
|
127
|
-
'aria-multiline'?: boolean | "
|
128
|
-
'aria-multiselectable'?: boolean | "
|
107
|
+
'aria-modal'?: boolean | "true" | "false" | undefined;
|
108
|
+
'aria-multiline'?: boolean | "true" | "false" | undefined;
|
109
|
+
'aria-multiselectable'?: boolean | "true" | "false" | undefined;
|
129
110
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
130
111
|
'aria-owns'?: string | undefined;
|
131
112
|
'aria-placeholder'?: string | undefined;
|
132
113
|
'aria-posinset'?: number | undefined;
|
133
|
-
'aria-pressed'?: boolean | "
|
134
|
-
'aria-readonly'?: boolean | "
|
114
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
115
|
+
'aria-readonly'?: boolean | "true" | "false" | undefined;
|
135
116
|
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
136
|
-
'aria-required'?: boolean | "
|
117
|
+
'aria-required'?: boolean | "true" | "false" | undefined;
|
137
118
|
'aria-roledescription'?: string | undefined;
|
138
119
|
'aria-rowcount'?: number | undefined;
|
139
120
|
'aria-rowindex'?: number | undefined;
|
140
121
|
'aria-rowspan'?: number | undefined;
|
141
|
-
'aria-selected'?: boolean | "
|
122
|
+
'aria-selected'?: boolean | "true" | "false" | undefined;
|
142
123
|
'aria-setsize'?: number | undefined;
|
143
124
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
144
125
|
'aria-valuemax'?: number | undefined;
|
@@ -308,16 +289,35 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<Pick<React.
|
|
308
289
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
309
290
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
310
291
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
292
|
+
bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
293
|
+
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
294
|
+
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
295
|
+
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
296
|
+
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
297
|
+
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
298
|
+
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
299
|
+
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
300
|
+
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
301
|
+
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
302
|
+
pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
303
|
+
pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
304
|
+
pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
305
|
+
pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
306
|
+
px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
307
|
+
paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
308
|
+
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
309
|
+
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
310
|
+
size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
311
311
|
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
312
|
-
variant?: "small" | "medium" | "large" | undefined;
|
313
312
|
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
314
|
-
disabled?: boolean | undefined;
|
315
313
|
autoFocus?: boolean | undefined;
|
314
|
+
disabled?: boolean | undefined;
|
316
315
|
formAction?: string | undefined;
|
317
316
|
formEncType?: string | undefined;
|
318
317
|
formMethod?: string | undefined;
|
319
318
|
formNoValidate?: boolean | undefined;
|
320
319
|
formTarget?: string | undefined;
|
320
|
+
variant?: "small" | "medium" | "large" | undefined;
|
321
321
|
} & {
|
322
322
|
theme?: any;
|
323
|
-
}>, "backgroundColor" | "color" | "display" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "
|
323
|
+
}>, "backgroundColor" | "color" | "display" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "sx" | "as" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "variant"> & React.RefAttributes<HTMLElement>>;
|
package/lib-esm/FilterList.d.ts
CHANGED
@@ -39,24 +39,6 @@ declare const _default: {
|
|
39
39
|
slot?: string | undefined;
|
40
40
|
style?: React.CSSProperties | undefined;
|
41
41
|
title?: string | undefined;
|
42
|
-
bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
43
|
-
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
44
|
-
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
45
|
-
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
46
|
-
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
47
|
-
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
48
|
-
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
49
|
-
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
50
|
-
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
51
|
-
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
52
|
-
pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
53
|
-
pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
54
|
-
pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
55
|
-
pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
56
|
-
px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
57
|
-
paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
58
|
-
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
59
|
-
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
60
42
|
key?: React.Key | null | undefined;
|
61
43
|
defaultChecked?: boolean | undefined;
|
62
44
|
defaultValue?: string | number | readonly string[] | undefined;
|
@@ -64,14 +46,14 @@ declare const _default: {
|
|
64
46
|
suppressHydrationWarning?: boolean | undefined;
|
65
47
|
accessKey?: string | undefined;
|
66
48
|
className?: string | undefined;
|
67
|
-
contentEditable?: "inherit" | (boolean | "
|
49
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
68
50
|
contextMenu?: string | undefined;
|
69
51
|
dir?: string | undefined;
|
70
|
-
draggable?: (boolean | "
|
52
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
71
53
|
id?: string | undefined;
|
72
54
|
lang?: string | undefined;
|
73
55
|
placeholder?: string | undefined;
|
74
|
-
spellCheck?: (boolean | "
|
56
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
75
57
|
tabIndex?: number | undefined;
|
76
58
|
radioGroup?: string | undefined;
|
77
59
|
role?: React.AriaRole | undefined;
|
@@ -97,47 +79,47 @@ declare const _default: {
|
|
97
79
|
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
98
80
|
is?: string | undefined;
|
99
81
|
'aria-activedescendant'?: string | undefined;
|
100
|
-
'aria-atomic'?: boolean | "
|
101
|
-
'aria-autocomplete'?: "none" | "
|
102
|
-
'aria-busy'?: boolean | "
|
103
|
-
'aria-checked'?: boolean | "
|
82
|
+
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
83
|
+
'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
|
84
|
+
'aria-busy'?: boolean | "true" | "false" | undefined;
|
85
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
104
86
|
'aria-colcount'?: number | undefined;
|
105
87
|
'aria-colindex'?: number | undefined;
|
106
88
|
'aria-colspan'?: number | undefined;
|
107
89
|
'aria-controls'?: string | undefined;
|
108
|
-
'aria-current'?: boolean | "time" | "
|
90
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
109
91
|
'aria-describedby'?: string | undefined;
|
110
92
|
'aria-details'?: string | undefined;
|
111
|
-
'aria-disabled'?: boolean | "
|
112
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
93
|
+
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
94
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
113
95
|
'aria-errormessage'?: string | undefined;
|
114
|
-
'aria-expanded'?: boolean | "
|
96
|
+
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
115
97
|
'aria-flowto'?: string | undefined;
|
116
|
-
'aria-grabbed'?: boolean | "
|
117
|
-
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "
|
118
|
-
'aria-hidden'?: boolean | "
|
119
|
-
'aria-invalid'?: boolean | "
|
98
|
+
'aria-grabbed'?: boolean | "true" | "false" | undefined;
|
99
|
+
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
|
100
|
+
'aria-hidden'?: boolean | "true" | "false" | undefined;
|
101
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
120
102
|
'aria-keyshortcuts'?: string | undefined;
|
121
103
|
'aria-label'?: string | undefined;
|
122
104
|
'aria-labelledby'?: string | undefined;
|
123
105
|
'aria-level'?: number | undefined;
|
124
106
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
125
|
-
'aria-modal'?: boolean | "
|
126
|
-
'aria-multiline'?: boolean | "
|
127
|
-
'aria-multiselectable'?: boolean | "
|
107
|
+
'aria-modal'?: boolean | "true" | "false" | undefined;
|
108
|
+
'aria-multiline'?: boolean | "true" | "false" | undefined;
|
109
|
+
'aria-multiselectable'?: boolean | "true" | "false" | undefined;
|
128
110
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
129
111
|
'aria-owns'?: string | undefined;
|
130
112
|
'aria-placeholder'?: string | undefined;
|
131
113
|
'aria-posinset'?: number | undefined;
|
132
|
-
'aria-pressed'?: boolean | "
|
133
|
-
'aria-readonly'?: boolean | "
|
114
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
115
|
+
'aria-readonly'?: boolean | "true" | "false" | undefined;
|
134
116
|
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
135
|
-
'aria-required'?: boolean | "
|
117
|
+
'aria-required'?: boolean | "true" | "false" | undefined;
|
136
118
|
'aria-roledescription'?: string | undefined;
|
137
119
|
'aria-rowcount'?: number | undefined;
|
138
120
|
'aria-rowindex'?: number | undefined;
|
139
121
|
'aria-rowspan'?: number | undefined;
|
140
|
-
'aria-selected'?: boolean | "
|
122
|
+
'aria-selected'?: boolean | "true" | "false" | undefined;
|
141
123
|
'aria-setsize'?: number | undefined;
|
142
124
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
143
125
|
'aria-valuemax'?: number | undefined;
|
@@ -307,6 +289,24 @@ declare const _default: {
|
|
307
289
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLUListElement> | undefined;
|
308
290
|
onTransitionEnd?: React.TransitionEventHandler<HTMLUListElement> | undefined;
|
309
291
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLUListElement> | undefined;
|
292
|
+
bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
293
|
+
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
294
|
+
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
295
|
+
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
296
|
+
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
297
|
+
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
298
|
+
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
299
|
+
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
300
|
+
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
301
|
+
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
302
|
+
pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
303
|
+
pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
304
|
+
pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
305
|
+
pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
306
|
+
px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
307
|
+
paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
308
|
+
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
309
|
+
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
310
310
|
sx?: import("./sx").BetterSystemStyleObject | undefined;
|
311
311
|
} & {
|
312
312
|
theme?: any;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { LabelSizeKeys } from './_newLabelStyleUtils';
|
3
|
+
export declare type LabelColorOptions = 'default' | 'primary' | 'secondary' | 'accent' | 'success' | 'attention' | 'severe' | 'danger' | 'done' | 'sponsors';
|
4
|
+
interface Props {
|
5
|
+
color?: LabelColorOptions;
|
6
|
+
size?: LabelSizeKeys;
|
7
|
+
filled?: boolean;
|
8
|
+
leadingVisual?: React.ComponentType<any>;
|
9
|
+
}
|
10
|
+
declare const NewLabel: React.FC<Props>;
|
11
|
+
export default NewLabel;
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled, { css } from 'styled-components';
|
3
|
+
import { get } from '../constants';
|
4
|
+
import { labelVariants } from './_newLabelStyleUtils';
|
5
|
+
const labelColorMap = {
|
6
|
+
default: {
|
7
|
+
borderColor: get('colors.border.default')
|
8
|
+
},
|
9
|
+
primary: {
|
10
|
+
borderColor: get('colors.fg.default')
|
11
|
+
},
|
12
|
+
secondary: {
|
13
|
+
borderColor: get('colors.border.muted'),
|
14
|
+
textColor: get('colors.fg.muted')
|
15
|
+
},
|
16
|
+
accent: {
|
17
|
+
borderColor: get('colors.accent.emphasis'),
|
18
|
+
textColor: get('colors.accent.fg')
|
19
|
+
},
|
20
|
+
success: {
|
21
|
+
borderColor: get('colors.success.emphasis'),
|
22
|
+
textColor: get('colors.success.fg')
|
23
|
+
},
|
24
|
+
attention: {
|
25
|
+
borderColor: get('colors.attention.emphasis'),
|
26
|
+
textColor: get('colors.attention.fg')
|
27
|
+
},
|
28
|
+
severe: {
|
29
|
+
borderColor: get('colors.severe.emphasis'),
|
30
|
+
textColor: get('colors.severe.fg')
|
31
|
+
},
|
32
|
+
danger: {
|
33
|
+
borderColor: get('colors.danger.emphasis'),
|
34
|
+
textColor: get('colors.danger.fg')
|
35
|
+
},
|
36
|
+
done: {
|
37
|
+
borderColor: get('colors.done.fg'),
|
38
|
+
textColor: get('colors.done.emphasis')
|
39
|
+
},
|
40
|
+
sponsors: {
|
41
|
+
borderColor: get('colors.sponsors.fg'),
|
42
|
+
textColor: get('colors.sponsors.emphasis')
|
43
|
+
}
|
44
|
+
};
|
45
|
+
const filledLabelColorMap = {
|
46
|
+
default: {
|
47
|
+
bgColor: get('colors.neutral.muted')
|
48
|
+
},
|
49
|
+
primary: {
|
50
|
+
bgColor: get('colors.neutral.emphasis'),
|
51
|
+
textColor: get('colors.fg.onEmphasis')
|
52
|
+
},
|
53
|
+
secondary: {
|
54
|
+
bgColor: get('colors.neutral.subtle'),
|
55
|
+
textColor: get('colors.fg.muted')
|
56
|
+
},
|
57
|
+
accent: {
|
58
|
+
bgColor: get('colors.accent.emphasis'),
|
59
|
+
textColor: get('colors.fg.onEmphasis')
|
60
|
+
},
|
61
|
+
success: {
|
62
|
+
bgColor: get('colors.success.emphasis'),
|
63
|
+
textColor: get('colors.fg.onEmphasis')
|
64
|
+
},
|
65
|
+
attention: {
|
66
|
+
bgColor: get('colors.attention.emphasis'),
|
67
|
+
textColor: get('colors.fg.onEmphasis')
|
68
|
+
},
|
69
|
+
severe: {
|
70
|
+
bgColor: get('colors.severe.emphasis'),
|
71
|
+
textColor: get('colors.fg.onEmphasis')
|
72
|
+
},
|
73
|
+
danger: {
|
74
|
+
bgColor: get('colors.danger.emphasis'),
|
75
|
+
textColor: get('colors.fg.onEmphasis')
|
76
|
+
},
|
77
|
+
done: {
|
78
|
+
bgColor: get('colors.done.fg'),
|
79
|
+
textColor: get('colors.fg.onEmphasis')
|
80
|
+
},
|
81
|
+
sponsors: {
|
82
|
+
bgColor: get('colors.sponsors.fg'),
|
83
|
+
textColor: get('colors.fg.onEmphasis')
|
84
|
+
}
|
85
|
+
};
|
86
|
+
const LeadingVisualContainer = styled('span').withConfig({
|
87
|
+
displayName: "NewLabel__LeadingVisualContainer",
|
88
|
+
componentId: "sc-6osasq-0"
|
89
|
+
})(["flex-shrink:0;line-height:0;margin-right:", ";"], get('space.1'));
|
90
|
+
const LabelContainer = styled.span.withConfig({
|
91
|
+
displayName: "NewLabel__LabelContainer",
|
92
|
+
componentId: "sc-6osasq-1"
|
93
|
+
})(["align-items:center;border-width:1px;border-radius:999px;border-style:solid;display:inline-flex;font-weight:", ";line-height:1;white-space:nowrap;", ";", ""], get('fontWeights.bold'), labelVariants, ({
|
94
|
+
color = 'default',
|
95
|
+
filled
|
96
|
+
}) => {
|
97
|
+
if (filled) {
|
98
|
+
return css(["background-color:", ";border-color:transparent;color:", ";"], filledLabelColorMap[color].bgColor, filledLabelColorMap[color].textColor);
|
99
|
+
} else {
|
100
|
+
return css(["background-color:transparent;border-color:", ";color:", ";"], labelColorMap[color].borderColor, labelColorMap[color].textColor);
|
101
|
+
}
|
102
|
+
});
|
103
|
+
|
104
|
+
const NewLabel = ({
|
105
|
+
children,
|
106
|
+
leadingVisual: LeadingVisual,
|
107
|
+
...other
|
108
|
+
}) => /*#__PURE__*/React.createElement(LabelContainer, other, LeadingVisual && /*#__PURE__*/React.createElement(LeadingVisualContainer, null, /*#__PURE__*/React.createElement(LeadingVisual, null)), children);
|
109
|
+
|
110
|
+
NewLabel.displayName = "NewLabel";
|
111
|
+
NewLabel.defaultProps = {
|
112
|
+
size: 'md',
|
113
|
+
color: 'default'
|
114
|
+
};
|
115
|
+
export default NewLabel;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { LabelSizeKeys } from './_newLabelStyleUtils';
|
3
|
+
declare type Statuses = 'issueClosed' | 'pullClosed' | 'pullMerged' | 'issueOpened' | 'pullOpened' | 'draft';
|
4
|
+
interface Props {
|
5
|
+
status: Statuses;
|
6
|
+
size?: LabelSizeKeys;
|
7
|
+
leadingVisual?: React.ComponentType<any>;
|
8
|
+
}
|
9
|
+
declare const NewStateLabel: React.FC<Props>;
|
10
|
+
export default NewStateLabel;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
import React from 'react';
|
4
|
+
import { GitMergeIcon, GitPullRequestIcon, IssueClosedIcon, IssueOpenedIcon } from '@primer/octicons-react';
|
5
|
+
import NewLabel from './NewLabel';
|
6
|
+
const colorMap = {
|
7
|
+
issueClosed: 'done',
|
8
|
+
pullClosed: 'done',
|
9
|
+
pullMerged: 'done',
|
10
|
+
issueOpened: 'success',
|
11
|
+
pullOpened: 'success',
|
12
|
+
draft: 'primary'
|
13
|
+
};
|
14
|
+
const octiconMap = {
|
15
|
+
issueOpened: IssueOpenedIcon,
|
16
|
+
pullOpened: GitPullRequestIcon,
|
17
|
+
issueClosed: IssueClosedIcon,
|
18
|
+
pullClosed: GitPullRequestIcon,
|
19
|
+
pullMerged: GitMergeIcon,
|
20
|
+
draft: GitPullRequestIcon
|
21
|
+
};
|
22
|
+
|
23
|
+
const NewStateLabel = ({
|
24
|
+
status,
|
25
|
+
...rest
|
26
|
+
}) => /*#__PURE__*/React.createElement(NewLabel, _extends({
|
27
|
+
filled: true,
|
28
|
+
color: colorMap[status],
|
29
|
+
leadingVisual: octiconMap[status]
|
30
|
+
}, rest));
|
31
|
+
|
32
|
+
NewStateLabel.displayName = "NewStateLabel";
|
33
|
+
NewStateLabel.defaultProps = {
|
34
|
+
size: 'lg'
|
35
|
+
};
|
36
|
+
export default NewStateLabel;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { variant } from 'styled-system';
|
2
|
+
// TODO: consider moving to Primitives
|
3
|
+
export const badgeSizes = {
|
4
|
+
sm: 20,
|
5
|
+
md: 24,
|
6
|
+
lg: 32
|
7
|
+
};
|
8
|
+
export const labelVariants = variant({
|
9
|
+
prop: 'size',
|
10
|
+
variants: {
|
11
|
+
sm: {
|
12
|
+
fontSize: 0,
|
13
|
+
height: `${badgeSizes.sm}px`,
|
14
|
+
paddingLeft: 2,
|
15
|
+
paddingRight: 2
|
16
|
+
},
|
17
|
+
md: {
|
18
|
+
fontSize: 0,
|
19
|
+
height: `${badgeSizes.md}px`,
|
20
|
+
paddingLeft: 2,
|
21
|
+
paddingRight: 2
|
22
|
+
},
|
23
|
+
lg: {
|
24
|
+
fontSize: 1,
|
25
|
+
height: `${badgeSizes.lg}px`,
|
26
|
+
paddingLeft: 3,
|
27
|
+
paddingRight: 3
|
28
|
+
}
|
29
|
+
}
|
30
|
+
});
|