@primer/components 0.0.0-2021108175016 → 0.0.0-2021108205537
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 +5 -3
- package/dist/browser.esm.js +472 -473
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +73 -74
- package/dist/browser.umd.js.map +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +28 -28
- package/lib/Autocomplete/AutocompleteInput.d.ts +28 -28
- package/lib/Button/Button.d.ts +25 -25
- package/lib/Button/ButtonClose.d.ts +45 -45
- package/lib/Button/ButtonDanger.d.ts +25 -25
- package/lib/Button/ButtonInvisible.d.ts +25 -25
- package/lib/Button/ButtonOutline.d.ts +25 -25
- package/lib/Button/ButtonPrimary.d.ts +25 -25
- package/lib/CircleOcticon.d.ts +42 -42
- package/lib/Dialog.d.ts +45 -45
- package/lib/Dropdown.d.ts +176 -176
- package/lib/DropdownMenu/DropdownButton.d.ts +46 -46
- package/lib/FilterList.d.ts +42 -42
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +246 -246
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/SideNav.d.ts +11 -8
- package/lib/SideNav.js +8 -15
- package/lib/TextInputWithTokens.d.ts +28 -28
- package/lib/Timeline.d.ts +43 -43
- 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 +28 -28
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +28 -28
- package/lib-esm/Button/Button.d.ts +25 -25
- package/lib-esm/Button/ButtonClose.d.ts +45 -45
- package/lib-esm/Button/ButtonDanger.d.ts +25 -25
- package/lib-esm/Button/ButtonInvisible.d.ts +25 -25
- package/lib-esm/Button/ButtonOutline.d.ts +25 -25
- package/lib-esm/Button/ButtonPrimary.d.ts +25 -25
- package/lib-esm/CircleOcticon.d.ts +42 -42
- package/lib-esm/Dialog.d.ts +45 -45
- package/lib-esm/Dropdown.d.ts +176 -176
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +46 -46
- package/lib-esm/FilterList.d.ts +42 -42
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +246 -246
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/SideNav.d.ts +11 -8
- package/lib-esm/SideNav.js +8 -16
- package/lib-esm/TextInputWithTokens.d.ts +28 -28
- package/lib-esm/Timeline.d.ts +43 -43
- 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 -63
- package/lib/ActionList2/Item.js +0 -234
- 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 -59
- 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 -63
- package/lib-esm/ActionList2/Item.js +0 -201
- 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 -37
- 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
package/lib-esm/Token/Token.d.ts
CHANGED
@@ -11,5 +11,5 @@ export interface TokenProps extends TokenBaseProps {
|
|
11
11
|
*/
|
12
12
|
hideRemoveButton?: boolean;
|
13
13
|
}
|
14
|
-
declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps & SxProp, "default" | "muted" | "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "
|
14
|
+
declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps & SxProp, "default" | "muted" | "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "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" | "start" | "step" | "size" | "wrap" | "open" | "sx" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "as" | "hrefLang" | "integrity" | "rel" | "charSet" | "download" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "leadingVisual" | "onRemove" | "isSelected" | "hideRemoveButton"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>>;
|
15
15
|
export default Token;
|
package/lib-esm/sx.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { SystemCssProperties, SystemStyleObject } from '@styled-system/css';
|
2
2
|
import { ThemeColorPaths, ThemeShadowPaths } from './theme';
|
3
3
|
import { ColorProps, ShadowProps } from 'styled-system';
|
4
|
-
import merge from 'deepmerge';
|
5
4
|
export declare type BetterCssProperties = {
|
6
5
|
[K in keyof SystemCssProperties]: K extends keyof ColorProps ? ThemeColorPaths | SystemCssProperties[K] : K extends keyof ShadowProps ? ThemeShadowPaths | SystemCssProperties[K] : SystemCssProperties[K];
|
7
6
|
};
|
@@ -11,4 +10,3 @@ export interface SxProp {
|
|
11
10
|
}
|
12
11
|
declare const sx: (props: SxProp) => import("@styled-system/css").CssFunctionReturnType;
|
13
12
|
export default sx;
|
14
|
-
export { merge };
|
package/lib-esm/sx.js
CHANGED
package/lib-esm/theme-preval.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
// this file was prevaled
|
2
2
|
// This file needs to be a JavaScript file using CommonJS to be compatiable with preval
|
3
|
-
// Cache bust: 2021-11-04 12:00:00 GMT (This file is cached by our deployment tooling, update this timestamp to rebuild this file)
|
4
3
|
module.exports = {
|
5
4
|
"theme": {
|
6
5
|
"animation": {
|
@@ -390,19 +389,6 @@ module.exports = {
|
|
390
389
|
"icon": "#6e7781",
|
391
390
|
"borderHover": "rgba(175,184,193,0.2)"
|
392
391
|
},
|
393
|
-
"actionListItem": {
|
394
|
-
"inlineDivider": "rgba(208,215,222,0.48)",
|
395
|
-
"default": {
|
396
|
-
"hoverBg": "rgba(208,215,222,0.32)",
|
397
|
-
"activeBg": "rgba(208,215,222,0.48)",
|
398
|
-
"selectedBg": "rgba(208,215,222,0.24)"
|
399
|
-
},
|
400
|
-
"danger": {
|
401
|
-
"hoverBg": "rgba(255,235,233,0.64)",
|
402
|
-
"activeBg": "#FFEBE9",
|
403
|
-
"hoverText": "#cf222e"
|
404
|
-
}
|
405
|
-
},
|
406
392
|
"fg": {
|
407
393
|
"default": "#24292f",
|
408
394
|
"muted": "#57606a",
|
@@ -529,7 +515,7 @@ module.exports = {
|
|
529
515
|
}
|
530
516
|
}
|
531
517
|
},
|
532
|
-
"
|
518
|
+
"light_protanopia": {
|
533
519
|
"colors": {
|
534
520
|
"canvasDefaultTransparent": "rgba(255,255,255,0)",
|
535
521
|
"marketingIcon": {
|
@@ -886,19 +872,6 @@ module.exports = {
|
|
886
872
|
"icon": "#6e7781",
|
887
873
|
"borderHover": "rgba(175,184,193,0.2)"
|
888
874
|
},
|
889
|
-
"actionListItem": {
|
890
|
-
"inlineDivider": "rgba(208,215,222,0.48)",
|
891
|
-
"default": {
|
892
|
-
"hoverBg": "rgba(208,215,222,0.32)",
|
893
|
-
"activeBg": "rgba(208,215,222,0.48)",
|
894
|
-
"selectedBg": "rgba(208,215,222,0.24)"
|
895
|
-
},
|
896
|
-
"danger": {
|
897
|
-
"hoverBg": "rgba(254,254,72,0.64)",
|
898
|
-
"activeBg": "#fefe48",
|
899
|
-
"hoverText": "#ac5e00"
|
900
|
-
}
|
901
|
-
},
|
902
875
|
"fg": {
|
903
876
|
"default": "#24292f",
|
904
877
|
"muted": "#57606a",
|
@@ -1382,19 +1355,6 @@ module.exports = {
|
|
1382
1355
|
"icon": "#484f58",
|
1383
1356
|
"borderHover": "rgba(110,118,129,0.4)"
|
1384
1357
|
},
|
1385
|
-
"actionListItem": {
|
1386
|
-
"inlineDivider": "rgba(48,54,61,0.48)",
|
1387
|
-
"default": {
|
1388
|
-
"hoverBg": "rgba(177,186,196,0.12)",
|
1389
|
-
"activeBg": "rgba(177,186,196,0.2)",
|
1390
|
-
"selectedBg": "rgba(177,186,196,0.08)"
|
1391
|
-
},
|
1392
|
-
"danger": {
|
1393
|
-
"hoverBg": "rgba(248,81,73,0.16)",
|
1394
|
-
"activeBg": "rgba(248,81,73,0.24)",
|
1395
|
-
"hoverText": "#ff7b72"
|
1396
|
-
}
|
1397
|
-
},
|
1398
1358
|
"fg": {
|
1399
1359
|
"default": "#c9d1d9",
|
1400
1360
|
"muted": "#8b949e",
|
@@ -1881,19 +1841,6 @@ module.exports = {
|
|
1881
1841
|
"icon": "#545d68",
|
1882
1842
|
"borderHover": "rgba(99,110,123,0.4)"
|
1883
1843
|
},
|
1884
|
-
"actionListItem": {
|
1885
|
-
"inlineDivider": "rgba(68,76,86,0.48)",
|
1886
|
-
"default": {
|
1887
|
-
"hoverBg": "rgba(144,157,171,0.12)",
|
1888
|
-
"activeBg": "rgba(144,157,171,0.2)",
|
1889
|
-
"selectedBg": "rgba(144,157,171,0.08)"
|
1890
|
-
},
|
1891
|
-
"danger": {
|
1892
|
-
"hoverBg": "rgba(229,83,75,0.16)",
|
1893
|
-
"activeBg": "rgba(229,83,75,0.24)",
|
1894
|
-
"hoverText": "#f47067"
|
1895
|
-
}
|
1896
|
-
},
|
1897
1844
|
"fg": {
|
1898
1845
|
"default": "#adbac7",
|
1899
1846
|
"muted": "#768390",
|
@@ -2380,19 +2327,6 @@ module.exports = {
|
|
2380
2327
|
"icon": "#f0f3f6",
|
2381
2328
|
"borderHover": "#bdc4cc"
|
2382
2329
|
},
|
2383
|
-
"actionListItem": {
|
2384
|
-
"inlineDivider": "#7a828e",
|
2385
|
-
"default": {
|
2386
|
-
"hoverBg": "rgba(217,222,227,0.12)",
|
2387
|
-
"activeBg": "rgba(217,222,227,0.24)",
|
2388
|
-
"selectedBg": "rgba(217,222,227,0.08)"
|
2389
|
-
},
|
2390
|
-
"danger": {
|
2391
|
-
"hoverBg": "#ff6a69",
|
2392
|
-
"activeBg": "#ff4445",
|
2393
|
-
"hoverText": "#0a0c10"
|
2394
|
-
}
|
2395
|
-
},
|
2396
2330
|
"fg": {
|
2397
2331
|
"default": "#f0f3f6",
|
2398
2332
|
"muted": "#f0f3f6",
|
@@ -2522,7 +2456,7 @@ module.exports = {
|
|
2522
2456
|
}
|
2523
2457
|
}
|
2524
2458
|
},
|
2525
|
-
"
|
2459
|
+
"dark_protanopia": {
|
2526
2460
|
"colors": {
|
2527
2461
|
"canvasDefaultTransparent": "rgba(13,17,23,0)",
|
2528
2462
|
"marketingIcon": {
|
@@ -2879,19 +2813,6 @@ module.exports = {
|
|
2879
2813
|
"icon": "#484f58",
|
2880
2814
|
"borderHover": "rgba(110,118,129,0.4)"
|
2881
2815
|
},
|
2882
|
-
"actionListItem": {
|
2883
|
-
"inlineDivider": "rgba(48,54,61,0.48)",
|
2884
|
-
"default": {
|
2885
|
-
"hoverBg": "rgba(177,186,196,0.12)",
|
2886
|
-
"activeBg": "rgba(177,186,196,0.2)",
|
2887
|
-
"selectedBg": "rgba(177,186,196,0.08)"
|
2888
|
-
},
|
2889
|
-
"danger": {
|
2890
|
-
"hoverBg": "rgba(195,128,0,0.16)",
|
2891
|
-
"activeBg": "rgba(195,128,0,0.24)",
|
2892
|
-
"hoverText": "#d69a00"
|
2893
|
-
}
|
2894
|
-
},
|
2895
2816
|
"fg": {
|
2896
2817
|
"default": "#c9d1d9",
|
2897
2818
|
"muted": "#8b949e",
|
@@ -53,7 +53,7 @@ export declare function render(component: React.ReactElement, theme?: {
|
|
53
53
|
xlarge: string;
|
54
54
|
};
|
55
55
|
space: string[];
|
56
|
-
colorSchemes: Record<"light" | "
|
56
|
+
colorSchemes: Record<"light" | "light_protanopia" | "dark" | "dark_dimmed" | "dark_high_contrast" | "dark_protanopia", Record<"colors" | "shadows", Partial<{
|
57
57
|
canvasDefaultTransparent: string;
|
58
58
|
marketingIcon: {
|
59
59
|
primary: string;
|
@@ -434,19 +434,6 @@ export declare function render(component: React.ReactElement, theme?: {
|
|
434
434
|
icon: string;
|
435
435
|
borderHover: string;
|
436
436
|
};
|
437
|
-
actionListItem: {
|
438
|
-
inlineDivider: string;
|
439
|
-
default: {
|
440
|
-
hoverBg: string;
|
441
|
-
activeBg: string;
|
442
|
-
selectedBg: string;
|
443
|
-
};
|
444
|
-
danger: {
|
445
|
-
hoverBg: string;
|
446
|
-
activeBg: string;
|
447
|
-
hoverText: string;
|
448
|
-
};
|
449
|
-
};
|
450
437
|
fg: {
|
451
438
|
default: string;
|
452
439
|
muted: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/components",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-2021108205537",
|
4
4
|
"description": "Primer react components",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "lib-esm/index.js",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
"license": "MIT",
|
45
45
|
"dependencies": {
|
46
46
|
"@primer/octicons-react": "^13.0.0",
|
47
|
-
"@primer/primitives": "
|
47
|
+
"@primer/primitives": "5.1.0",
|
48
48
|
"@radix-ui/react-polymorphic": "0.0.14",
|
49
49
|
"@react-aria/ssr": "3.1.0",
|
50
50
|
"@styled-system/css": "5.1.5",
|
@@ -124,8 +124,6 @@
|
|
124
124
|
"lodash.isobject": "3.0.2",
|
125
125
|
"prettier": "2.3.2",
|
126
126
|
"react": "17.0.2",
|
127
|
-
"react-dnd": "14.0.4",
|
128
|
-
"react-dnd-html5-backend": "14.0.2",
|
129
127
|
"react-dom": "17.0.2",
|
130
128
|
"react-test-renderer": "17.0.2",
|
131
129
|
"rollup": "2.56.3",
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { SxProp } from '../sx';
|
3
|
-
export declare type DescriptionProps = {
|
4
|
-
/**
|
5
|
-
* Secondary text style variations.
|
6
|
-
*
|
7
|
-
* - `"inline"` - Secondary text is positioned beside primary text.
|
8
|
-
* - `"block"` - Secondary text is positioned below primary text.
|
9
|
-
*/
|
10
|
-
variant?: 'inline' | 'block';
|
11
|
-
} & SxProp;
|
12
|
-
export declare const Description: React.FC<DescriptionProps>;
|
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Description = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
11
|
-
|
12
|
-
var _sx = require("../sx");
|
13
|
-
|
14
|
-
var _Truncate = _interopRequireDefault(require("../Truncate"));
|
15
|
-
|
16
|
-
var _Item = require("./Item");
|
17
|
-
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
|
-
const Description = ({
|
21
|
-
variant = 'inline',
|
22
|
-
sx = {},
|
23
|
-
...props
|
24
|
-
}) => {
|
25
|
-
const styles = {
|
26
|
-
color: 'fg.muted',
|
27
|
-
fontSize: 0,
|
28
|
-
lineHeight: '16px',
|
29
|
-
flexGrow: 1,
|
30
|
-
flexBasis: 0,
|
31
|
-
minWidth: 0,
|
32
|
-
marginLeft: variant === 'block' ? 0 : 2
|
33
|
-
};
|
34
|
-
return /*#__PURE__*/_react.default.createElement(_Item.Slot, {
|
35
|
-
name: variant === 'block' ? 'BlockDescription' : 'InlineDescription'
|
36
|
-
}, ({
|
37
|
-
blockDescriptionId,
|
38
|
-
inlineDescriptionId
|
39
|
-
}) => variant === 'block' ? /*#__PURE__*/_react.default.createElement(_Box.default, {
|
40
|
-
as: "span",
|
41
|
-
sx: (0, _sx.merge)(styles, sx),
|
42
|
-
id: blockDescriptionId
|
43
|
-
}, props.children) : /*#__PURE__*/_react.default.createElement(_Truncate.default, {
|
44
|
-
id: inlineDescriptionId,
|
45
|
-
sx: (0, _sx.merge)(styles, sx),
|
46
|
-
title: props.children,
|
47
|
-
inline: true,
|
48
|
-
maxWidth: "100%"
|
49
|
-
}, props.children));
|
50
|
-
};
|
51
|
-
|
52
|
-
exports.Description = Description;
|
53
|
-
Description.displayName = "Description";
|
@@ -1,35 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Divider = Divider;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
11
|
-
|
12
|
-
var _constants = require("../constants");
|
13
|
-
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
|
-
/**
|
17
|
-
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
18
|
-
*/
|
19
|
-
function Divider() {
|
20
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
21
|
-
as: "li",
|
22
|
-
role: "separator",
|
23
|
-
sx: {
|
24
|
-
height: 1,
|
25
|
-
backgroundColor: 'actionListItem.inlineDivider',
|
26
|
-
marginTop: theme => `calc(${(0, _constants.get)('space.2')(theme)} - 1px)`,
|
27
|
-
marginBottom: 2,
|
28
|
-
listStyle: 'none' // hide the ::marker inserted by browser's stylesheet
|
29
|
-
|
30
|
-
},
|
31
|
-
"data-component": "ActionList.Divider"
|
32
|
-
});
|
33
|
-
}
|
34
|
-
|
35
|
-
Divider.displayName = "Divider";
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { SxProp } from '../sx';
|
3
|
-
import { HeaderProps } from './Header';
|
4
|
-
import { ListProps } from './List';
|
5
|
-
export declare type GroupProps = HeaderProps & SxProp & {
|
6
|
-
selectionVariant?: ListProps['selectionVariant'] | false;
|
7
|
-
};
|
8
|
-
declare type ContextProps = Pick<GroupProps, 'selectionVariant'>;
|
9
|
-
export declare const GroupContext: React.Context<ContextProps>;
|
10
|
-
export declare const Group: React.FC<GroupProps>;
|
11
|
-
export {};
|
package/lib/ActionList2/Group.js
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Group = exports.GroupContext = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
11
|
-
|
12
|
-
var _Header = require("./Header");
|
13
|
-
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
|
-
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); }
|
17
|
-
|
18
|
-
const GroupContext = /*#__PURE__*/_react.default.createContext({});
|
19
|
-
|
20
|
-
exports.GroupContext = GroupContext;
|
21
|
-
|
22
|
-
const Group = ({
|
23
|
-
title,
|
24
|
-
variant,
|
25
|
-
auxiliaryText,
|
26
|
-
selectionVariant,
|
27
|
-
sx = {},
|
28
|
-
...props
|
29
|
-
}) => {
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
31
|
-
as: "li",
|
32
|
-
sx: {
|
33
|
-
'&:not(:first-child)': {
|
34
|
-
marginTop: 2
|
35
|
-
},
|
36
|
-
listStyle: 'none',
|
37
|
-
// hide the ::marker inserted by browser's stylesheet
|
38
|
-
...sx
|
39
|
-
}
|
40
|
-
}, props), title && /*#__PURE__*/_react.default.createElement(_Header.Header, {
|
41
|
-
title: title,
|
42
|
-
variant: variant,
|
43
|
-
auxiliaryText: auxiliaryText
|
44
|
-
}), /*#__PURE__*/_react.default.createElement(GroupContext.Provider, {
|
45
|
-
value: {
|
46
|
-
selectionVariant
|
47
|
-
}
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
49
|
-
as: "ul",
|
50
|
-
sx: {
|
51
|
-
paddingInlineStart: 0
|
52
|
-
}
|
53
|
-
}, props.children)));
|
54
|
-
};
|
55
|
-
|
56
|
-
exports.Group = Group;
|
57
|
-
Group.displayName = "Group";
|
@@ -1,26 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { SxProp } from '../sx';
|
3
|
-
/**
|
4
|
-
* Contract for props passed to the `Header` component.
|
5
|
-
*/
|
6
|
-
export declare type HeaderProps = {
|
7
|
-
/**
|
8
|
-
* Style variations. Usage is discretionary.
|
9
|
-
*
|
10
|
-
* - `"filled"` - Superimposed on a background, offset from nearby content
|
11
|
-
* - `"subtle"` - Relatively less offset from nearby content
|
12
|
-
*/
|
13
|
-
variant?: 'subtle' | 'filled';
|
14
|
-
/**
|
15
|
-
* Primary text which names a `Group`.
|
16
|
-
*/
|
17
|
-
title?: string;
|
18
|
-
/**
|
19
|
-
* Secondary text which provides additional information about a `Group`.
|
20
|
-
*/
|
21
|
-
auxiliaryText?: string;
|
22
|
-
} & SxProp;
|
23
|
-
/**
|
24
|
-
* Displays the name and description of a `Group`.
|
25
|
-
*/
|
26
|
-
export declare const Header: ({ variant, title, auxiliaryText, sx, ...props }: HeaderProps) => JSX.Element;
|
@@ -1,55 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Header = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
11
|
-
|
12
|
-
var _List = require("./List");
|
13
|
-
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
|
-
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); }
|
17
|
-
|
18
|
-
/**
|
19
|
-
* Displays the name and description of a `Group`.
|
20
|
-
*/
|
21
|
-
const Header = ({
|
22
|
-
variant = 'subtle',
|
23
|
-
title,
|
24
|
-
auxiliaryText,
|
25
|
-
sx = {},
|
26
|
-
...props
|
27
|
-
}) => {
|
28
|
-
const {
|
29
|
-
variant: listVariant
|
30
|
-
} = _react.default.useContext(_List.ListContext);
|
31
|
-
|
32
|
-
const styles = {
|
33
|
-
paddingY: '6px',
|
34
|
-
paddingX: listVariant === 'full' ? 2 : 3,
|
35
|
-
fontSize: 0,
|
36
|
-
fontWeight: 'bold',
|
37
|
-
color: 'fg.muted',
|
38
|
-
...(variant === 'filled' && {
|
39
|
-
backgroundColor: 'canvas.subtle',
|
40
|
-
marginX: 0,
|
41
|
-
marginBottom: 2,
|
42
|
-
borderTop: '1px solid',
|
43
|
-
borderBottom: '1px solid',
|
44
|
-
borderColor: 'neutral.muted'
|
45
|
-
}),
|
46
|
-
...sx
|
47
|
-
};
|
48
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
49
|
-
sx: styles,
|
50
|
-
role: "heading"
|
51
|
-
}, props), title, auxiliaryText && /*#__PURE__*/_react.default.createElement("span", null, auxiliaryText));
|
52
|
-
};
|
53
|
-
|
54
|
-
exports.Header = Header;
|
55
|
-
Header.displayName = "Header";
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ForwardRefComponent as PolymorphicForwardRefComponent } from '@radix-ui/react-polymorphic';
|
3
|
-
import { SxProp } from '../sx';
|
4
|
-
import { AriaRole } from '../utils/types';
|
5
|
-
export declare const getVariantStyles: (variant: ItemProps['variant'], disabled: ItemProps['disabled']) => {
|
6
|
-
color: string;
|
7
|
-
iconColor: string;
|
8
|
-
annotationColor: string;
|
9
|
-
hoverColor?: undefined;
|
10
|
-
} | {
|
11
|
-
color: string;
|
12
|
-
iconColor: string;
|
13
|
-
annotationColor: string;
|
14
|
-
hoverColor: string;
|
15
|
-
};
|
16
|
-
export declare type ItemProps = {
|
17
|
-
/**
|
18
|
-
* Primary content for an Item
|
19
|
-
*/
|
20
|
-
children?: React.ReactNode;
|
21
|
-
/**
|
22
|
-
* Callback that will trigger both on click selection and keyboard selection.
|
23
|
-
*/
|
24
|
-
onSelect?: (event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>) => void;
|
25
|
-
/**
|
26
|
-
* Is the `Item` is currently selected?
|
27
|
-
*/
|
28
|
-
selected?: boolean;
|
29
|
-
/**
|
30
|
-
* Style variations associated with various `Item` types.
|
31
|
-
*
|
32
|
-
* - `"default"` - An action `Item`.
|
33
|
-
* - `"danger"` - A destructive action `Item`.
|
34
|
-
*/
|
35
|
-
variant?: 'default' | 'danger';
|
36
|
-
/**
|
37
|
-
* Items that are disabled can not be clicked, selected, or navigated through.
|
38
|
-
*/
|
39
|
-
disabled?: boolean;
|
40
|
-
/**
|
41
|
-
* The ARIA role describing the function of `Item` component. `option` is a common value.
|
42
|
-
*/
|
43
|
-
role?: AriaRole;
|
44
|
-
/**
|
45
|
-
* id to attach to the root element of the Item
|
46
|
-
*/
|
47
|
-
id?: string;
|
48
|
-
/**
|
49
|
-
* Private API for use internally only. Used by LinkItem to wrap contents in an anchor
|
50
|
-
*/
|
51
|
-
_PrivateItemWrapper?: React.FC;
|
52
|
-
} & SxProp;
|
53
|
-
declare const Slot: React.FC<{
|
54
|
-
name: "LeadingVisual" | "InlineDescription" | "BlockDescription" | "TrailingVisual";
|
55
|
-
children: React.ReactNode;
|
56
|
-
}>;
|
57
|
-
export { Slot };
|
58
|
-
export declare type ItemContext = Pick<ItemProps, 'variant' | 'disabled'> & {
|
59
|
-
inlineDescriptionId: string;
|
60
|
-
blockDescriptionId: string;
|
61
|
-
};
|
62
|
-
export declare const TEXT_ROW_HEIGHT = "20px";
|
63
|
-
export declare const Item: PolymorphicForwardRefComponent<"li", ItemProps>;
|