@primer/components 0.0.0-202110229331 → 0.0.0-2021102321921
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 +68 -6
- package/dist/browser.esm.js +690 -759
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +294 -363
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Group.d.ts +28 -2
- package/lib/ActionList2/Group.js +55 -6
- package/lib/ActionList2/Group.jsx +33 -4
- package/lib/ActionList2/List.d.ts +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib/Breadcrumbs.d.ts +8 -7
- package/lib/Breadcrumbs.js +7 -12
- package/lib/Breadcrumbs.jsx +3 -6
- package/lib/Button/Button.d.ts +2 -3
- package/lib/Button/Button.js +2 -6
- package/lib/Button/Button.jsx +1 -21
- package/lib/Button/ButtonBase.d.ts +5 -8
- package/lib/Button/ButtonBase.js +1 -5
- package/lib/Button/ButtonBase.jsx +0 -3
- package/lib/Button/ButtonClose.d.ts +3 -46
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonClose.jsx +0 -2
- package/lib/Button/ButtonDanger.d.ts +2 -3
- package/lib/Button/ButtonDanger.js +2 -6
- package/lib/Button/ButtonDanger.jsx +1 -21
- package/lib/Button/ButtonInvisible.d.ts +2 -3
- package/lib/Button/ButtonInvisible.js +2 -6
- package/lib/Button/ButtonInvisible.jsx +1 -21
- package/lib/Button/ButtonOutline.d.ts +2 -3
- package/lib/Button/ButtonOutline.js +2 -6
- package/lib/Button/ButtonOutline.jsx +1 -21
- package/lib/Button/ButtonPrimary.d.ts +2 -3
- package/lib/Button/ButtonPrimary.js +2 -6
- package/lib/Button/ButtonPrimary.jsx +1 -21
- package/lib/Button/ButtonTableList.d.ts +1 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Button/ButtonTableList.jsx +0 -3
- package/lib/CircleBadge.d.ts +4 -5
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleBadge.jsx +0 -1
- package/lib/CircleOcticon.d.ts +1 -1
- package/lib/CounterLabel.d.ts +1 -2
- package/lib/CounterLabel.js +1 -1
- package/lib/CounterLabel.jsx +0 -1
- package/lib/Dialog/Dialog.d.ts +5 -9
- package/lib/Dialog/Dialog.js +17 -11
- package/lib/Dialog/Dialog.jsx +13 -7
- package/lib/Dialog.d.ts +4 -5
- package/lib/Dialog.js +1 -1
- package/lib/Dialog.jsx +0 -2
- package/lib/Dropdown.d.ts +10 -99
- package/lib/Dropdown.js +3 -3
- package/lib/Dropdown.jsx +0 -3
- package/lib/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib/DropdownMenu/DropdownButton.js +3 -1
- package/lib/DropdownMenu/DropdownButton.jsx +1 -1
- package/lib/FilterList.d.ts +264 -303
- package/lib/FilterList.js +2 -6
- package/lib/FilterList.jsx +2 -6
- package/lib/FilteredSearch.d.ts +1 -2
- package/lib/FilteredSearch.js +1 -1
- package/lib/FilteredSearch.jsx +0 -1
- package/lib/Flash.d.ts +1 -2
- package/lib/Flash.js +1 -1
- package/lib/Flash.jsx +0 -1
- package/lib/FormGroup.d.ts +4 -5
- package/lib/FormGroup.js +2 -2
- package/lib/FormGroup.jsx +0 -3
- package/lib/Header.d.ts +6 -7
- package/lib/Header.js +4 -4
- package/lib/Header.jsx +0 -7
- package/lib/Label.d.ts +1 -2
- package/lib/Label.js +2 -3
- package/lib/Label.jsx +1 -3
- package/lib/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup.js +1 -1
- package/lib/LabelGroup.jsx +0 -1
- package/lib/Link.d.ts +1 -2
- package/lib/Link.js +1 -1
- package/lib/Link.jsx +0 -2
- package/lib/NewButton/button.js +1 -12
- package/lib/NewButton/button.jsx +3 -7
- package/lib/Overlay.d.ts +11 -10
- package/lib/Overlay.js +3 -4
- package/lib/Overlay.jsx +1 -3
- package/lib/Pagehead.d.ts +1 -2
- package/lib/Pagehead.js +1 -1
- package/lib/Pagehead.jsx +0 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/Pagination.jsx +0 -2
- package/lib/Popover.d.ts +4 -5
- package/lib/Popover.js +4 -5
- package/lib/Popover.jsx +1 -9
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +21 -189
- package/lib/SelectMenu/SelectMenu.js +1 -3
- package/lib/SelectMenu/SelectMenu.jsx +0 -2
- package/lib/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.jsx +0 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.jsx +0 -1
- package/lib/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.jsx +0 -1
- package/lib/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuHeader.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.jsx +0 -2
- package/lib/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.jsx +0 -1
- package/lib/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuList.jsx +0 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +3 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +2 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuModal.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.jsx +0 -1
- package/lib/SideNav.d.ts +11 -8
- package/lib/SideNav.js +8 -15
- package/lib/SideNav.jsx +2 -6
- package/lib/StateLabel.d.ts +1 -2
- package/lib/StateLabel.js +6 -5
- package/lib/StateLabel.jsx +1 -2
- package/lib/StyledOcticon.d.ts +1 -2
- package/lib/StyledOcticon.js +1 -3
- package/lib/StyledOcticon.jsx +0 -2
- package/lib/SubNav.d.ts +5 -11
- package/lib/SubNav.js +7 -12
- package/lib/SubNav.jsx +4 -7
- package/lib/TabNav.d.ts +3 -4
- package/lib/TabNav.js +2 -2
- package/lib/TabNav.jsx +0 -2
- package/lib/TextInputWithTokens.d.ts +3 -3
- package/lib/Timeline.d.ts +19 -393
- package/lib/Timeline.js +16 -13
- package/lib/Timeline.jsx +9 -10
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Tooltip.d.ts +1 -2
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.jsx +1 -1
- package/lib/Truncate.d.ts +1 -2
- package/lib/Truncate.js +1 -3
- package/lib/Truncate.jsx +0 -3
- package/lib/UnderlineNav.d.ts +2 -3
- package/lib/UnderlineNav.js +2 -2
- package/lib/UnderlineNav.jsx +0 -2
- package/lib/index.d.ts +0 -2
- package/lib/index.js +1 -3
- package/lib-esm/ActionList2/Group.d.ts +28 -2
- package/lib-esm/ActionList2/Group.js +52 -5
- package/lib-esm/ActionList2/List.d.ts +1 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib-esm/Breadcrumbs.d.ts +8 -7
- package/lib-esm/Breadcrumbs.js +8 -13
- package/lib-esm/Button/Button.d.ts +2 -3
- package/lib-esm/Button/Button.js +2 -2
- package/lib-esm/Button/ButtonBase.d.ts +5 -8
- package/lib-esm/Button/ButtonBase.js +1 -3
- package/lib-esm/Button/ButtonClose.d.ts +3 -46
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -3
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +2 -3
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +2 -3
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +2 -3
- package/lib-esm/Button/ButtonPrimary.js +2 -2
- package/lib-esm/Button/ButtonTableList.d.ts +1 -2
- package/lib-esm/Button/ButtonTableList.js +2 -2
- package/lib-esm/CircleBadge.d.ts +4 -5
- package/lib-esm/CircleBadge.js +2 -2
- package/lib-esm/CircleOcticon.d.ts +1 -1
- package/lib-esm/CounterLabel.d.ts +1 -2
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/Dialog.d.ts +5 -9
- package/lib-esm/Dialog/Dialog.js +12 -12
- package/lib-esm/Dialog.d.ts +4 -5
- package/lib-esm/Dialog.js +2 -2
- package/lib-esm/Dropdown.d.ts +10 -99
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib-esm/DropdownMenu/DropdownButton.js +3 -1
- package/lib-esm/FilterList.d.ts +264 -303
- package/lib-esm/FilterList.js +3 -7
- package/lib-esm/FilteredSearch.d.ts +1 -2
- package/lib-esm/FilteredSearch.js +2 -2
- package/lib-esm/Flash.d.ts +1 -2
- package/lib-esm/Flash.js +2 -2
- package/lib-esm/FormGroup.d.ts +4 -5
- package/lib-esm/FormGroup.js +3 -3
- package/lib-esm/Header.d.ts +6 -7
- package/lib-esm/Header.js +5 -5
- package/lib-esm/Label.d.ts +1 -2
- package/lib-esm/Label.js +3 -4
- package/lib-esm/LabelGroup.d.ts +1 -2
- package/lib-esm/LabelGroup.js +2 -2
- package/lib-esm/Link.d.ts +1 -2
- package/lib-esm/Link.js +2 -2
- package/lib-esm/NewButton/button.js +0 -11
- package/lib-esm/Overlay.d.ts +11 -10
- package/lib-esm/Overlay.js +2 -3
- package/lib-esm/Pagehead.d.ts +1 -2
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Popover.d.ts +4 -5
- package/lib-esm/Popover.js +4 -5
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +21 -189
- package/lib-esm/SelectMenu/SelectMenu.js +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFilter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +3 -2
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib-esm/SideNav.d.ts +11 -8
- package/lib-esm/SideNav.js +8 -16
- package/lib-esm/StateLabel.d.ts +1 -2
- package/lib-esm/StateLabel.js +7 -6
- package/lib-esm/StyledOcticon.d.ts +1 -2
- package/lib-esm/StyledOcticon.js +1 -2
- package/lib-esm/SubNav.d.ts +5 -11
- package/lib-esm/SubNav.js +8 -13
- package/lib-esm/TabNav.d.ts +3 -4
- package/lib-esm/TabNav.js +3 -3
- package/lib-esm/TextInputWithTokens.d.ts +3 -3
- package/lib-esm/Timeline.d.ts +19 -393
- package/lib-esm/Timeline.js +12 -13
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Tooltip.d.ts +1 -2
- package/lib-esm/Tooltip.js +2 -2
- package/lib-esm/Truncate.d.ts +1 -2
- package/lib-esm/Truncate.js +1 -2
- package/lib-esm/UnderlineNav.d.ts +2 -3
- package/lib-esm/UnderlineNav.js +3 -3
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -1
- package/package.json +2 -2
- package/lib/Checkbox.d.ts +0 -29
- package/lib/Checkbox.js +0 -65
- package/lib/Checkbox.jsx +0 -50
- package/lib-esm/Checkbox.d.ts +0 -29
- package/lib-esm/Checkbox.js +0 -45
package/lib-esm/Timeline.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
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
1
|
import classnames from 'classnames';
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import Box from '
|
|
7
|
-
import {
|
|
4
|
+
import { Box } from '.';
|
|
5
|
+
import { get } from './constants';
|
|
8
6
|
import sx from './sx';
|
|
9
|
-
const Timeline = styled
|
|
7
|
+
const Timeline = styled.div.withConfig({
|
|
10
8
|
displayName: "Timeline",
|
|
11
9
|
componentId: "c4dq2e-0"
|
|
12
10
|
})(["display:flex;flex-direction:column;", " ", ";"], props => props.clipSidebar && css([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"]), sx);
|
|
13
|
-
const TimelineItem = styled
|
|
11
|
+
const TimelineItem = styled.div.attrs(props => ({
|
|
14
12
|
className: classnames('Timeline-Item', props.className)
|
|
15
13
|
})).withConfig({
|
|
16
14
|
displayName: "Timeline__TimelineItem",
|
|
17
15
|
componentId: "c4dq2e-1"
|
|
18
|
-
})(["display:flex;position:relative;padding:", " 0;margin-left:", ";&::before{position:absolute;top:0;bottom:0;left:0;display:block;width:2px;content:'';background-color:", ";}", " ", ";"
|
|
16
|
+
})(["display:flex;position:relative;padding:", " 0;margin-left:", ";&::before{position:absolute;top:0;bottom:0;left:0;display:block;width:2px;content:'';background-color:", ";}", " ", ";"], get('space.3'), get('space.3'), get('colors.border.muted'), props => props.condensed && css(["padding-top:", ";padding-bottom:0;&:last-child{padding-bottom:", ";}.TimelineItem-Badge{height:16px;margin-top:", ";margin-bottom:", ";color:", ";background-color:", ";border:0;}"], get('space.1'), get('space.3'), get('space.2'), get('space.2'), get('colors.fg.muted'), get('colors.canvas.default')), sx);
|
|
19
17
|
|
|
20
18
|
const TimelineBadge = props => {
|
|
21
19
|
return /*#__PURE__*/React.createElement(Box, {
|
|
22
20
|
position: "relative",
|
|
23
21
|
zIndex: 1
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Box,
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
25
23
|
display: "flex",
|
|
26
|
-
className:
|
|
24
|
+
className: "TimelineItem-Badge",
|
|
27
25
|
flexShrink: 0,
|
|
28
26
|
borderRadius: "50%",
|
|
29
27
|
borderWidth: "2px",
|
|
@@ -37,16 +35,17 @@ const TimelineBadge = props => {
|
|
|
37
35
|
mr: 2,
|
|
38
36
|
ml: "-15px",
|
|
39
37
|
alignItems: "center",
|
|
40
|
-
justifyContent: "center"
|
|
41
|
-
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
sx: props.sx
|
|
40
|
+
}, props.children));
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
TimelineBadge.displayName = "TimelineBadge";
|
|
45
|
-
const TimelineBody = styled
|
|
44
|
+
const TimelineBody = styled.div.withConfig({
|
|
46
45
|
displayName: "Timeline__TimelineBody",
|
|
47
46
|
componentId: "c4dq2e-2"
|
|
48
47
|
})(["min-width:0;max-width:100%;margin-top:", ";color:", ";flex:auto;font-size:", ";", ";"], get('space.1'), get('colors.fg.muted'), get('fontSizes.1'), sx);
|
|
49
|
-
const TimelineBreak = styled
|
|
48
|
+
const TimelineBreak = styled.div.withConfig({
|
|
50
49
|
displayName: "Timeline__TimelineBreak",
|
|
51
50
|
componentId: "c4dq2e-3"
|
|
52
51
|
})(["position:relative z-index:1;height:24px;margin:0;margin-bottom:-", ";margin-left:0;background-color:", ";border:0;border-top:", " solid ", ";", ";"], get('space.3'), get('colors.canvas.default'), get('space.1'), get('colors.border.default'), sx);
|
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" | "start" | "size" | "wrap" | "open" | "list" | "multiple" | "
|
|
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" | "start" | "size" | "wrap" | "open" | "list" | "multiple" | "role" | "sx" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "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" | "as" | "step" | "disabled" | "selected" | "download" | "href" | "hrefLang" | "media" | "rel" | "target" | "max" | "method" | "min" | "crossOrigin" | "classID" | "useMap" | "wmode" | "integrity" | "charSet" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "playsInline" | "preload" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "async" | "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/Tooltip.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SystemCommonProps } from './constants';
|
|
3
2
|
import { SxProp } from './sx';
|
|
4
3
|
import { ComponentProps } from './utils/types';
|
|
5
|
-
declare const TooltipBase: import("styled-components").StyledComponent<"span", any,
|
|
4
|
+
declare const TooltipBase: import("styled-components").StyledComponent<"span", any, SxProp, never>;
|
|
6
5
|
export declare type TooltipProps = {
|
|
7
6
|
direction?: 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
8
7
|
text?: string;
|
package/lib-esm/Tooltip.js
CHANGED
|
@@ -3,12 +3,12 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
-
import {
|
|
6
|
+
import { get } from './constants';
|
|
7
7
|
import sx from './sx';
|
|
8
8
|
const TooltipBase = styled.span.withConfig({
|
|
9
9
|
displayName: "Tooltip__TooltipBase",
|
|
10
10
|
componentId: "kp39nc-0"
|
|
11
|
-
})(["position:relative;&::before{position:absolute;z-index:1000001;display:none;width:0px;height:0px;color:", ";pointer-events:none;content:'';border:6px solid transparent;opacity:0;}&::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 ", ";-webkit-font-smoothing:subpixel-antialiased;color:", ";text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:", ";border-radius:", ";opacity:0;}@keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}&:hover,&:active,&:focus{&::before,&::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0.4s;}}&.tooltipped-no-delay:hover,&.tooltipped-no-delay:active,&.tooltipped-no-delay:focus{&::before,&::after{animation-delay:0s;}}&.tooltipped-multiline:hover,&.tooltipped-multiline:active,&.tooltipped-multiline:focus{&::after{display:table-cell;}}&.tooltipped-s,&.tooltipped-se,&.tooltipped-sw{&::after{top:100%;right:50%;margin-top:6px;}&::before{top:auto;right:50%;bottom:-7px;margin-right:-6px;border-bottom-color:", ";}}&.tooltipped-se{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-sw::after{margin-right:-", ";}&.tooltipped-n,&.tooltipped-ne,&.tooltipped-nw{&::after{right:50%;bottom:100%;margin-bottom:6px;}&::before{top:-7px;right:50%;bottom:auto;margin-right:-6px;border-top-color:", ";}}&.tooltipped-ne{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-nw::after{margin-right:-", ";}&.tooltipped-s::after,&.tooltipped-n::after{transform:translateX(50%);}&.tooltipped-w{&::after{right:100%;bottom:50%;margin-right:6px;transform:translateY(50%);}&::before{top:50%;bottom:50%;left:-7px;margin-top:-6px;border-left-color:", ";}}&.tooltipped-e{&::after{bottom:50%;left:100%;margin-left:6px;transform:translateY(50%);}&::before{top:50%;right:-7px;bottom:50%;margin-top:-6px;border-right-color:", ";}}&.tooltipped-multiline{&::after{width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}&.tooltipped-s::after,&.tooltipped-n::after{right:auto;left:50%;transform:translateX(-50%);}&.tooltipped-w::after,&.tooltipped-e::after{right:100%;}}&.tooltipped-align-right-2::after{right:0;margin-right:0;}&.tooltipped-align-right-2::before{right:15px;}&.tooltipped-align-left-2::after{left:0;margin-left:0;}&.tooltipped-align-left-2::before{left:10px;}", ";"
|
|
11
|
+
})(["position:relative;&::before{position:absolute;z-index:1000001;display:none;width:0px;height:0px;color:", ";pointer-events:none;content:'';border:6px solid transparent;opacity:0;}&::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 ", ";-webkit-font-smoothing:subpixel-antialiased;color:", ";text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:", ";border-radius:", ";opacity:0;}@keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}&:hover,&:active,&:focus{&::before,&::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0.4s;}}&.tooltipped-no-delay:hover,&.tooltipped-no-delay:active,&.tooltipped-no-delay:focus{&::before,&::after{animation-delay:0s;}}&.tooltipped-multiline:hover,&.tooltipped-multiline:active,&.tooltipped-multiline:focus{&::after{display:table-cell;}}&.tooltipped-s,&.tooltipped-se,&.tooltipped-sw{&::after{top:100%;right:50%;margin-top:6px;}&::before{top:auto;right:50%;bottom:-7px;margin-right:-6px;border-bottom-color:", ";}}&.tooltipped-se{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-sw::after{margin-right:-", ";}&.tooltipped-n,&.tooltipped-ne,&.tooltipped-nw{&::after{right:50%;bottom:100%;margin-bottom:6px;}&::before{top:-7px;right:50%;bottom:auto;margin-right:-6px;border-top-color:", ";}}&.tooltipped-ne{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-nw::after{margin-right:-", ";}&.tooltipped-s::after,&.tooltipped-n::after{transform:translateX(50%);}&.tooltipped-w{&::after{right:100%;bottom:50%;margin-right:6px;transform:translateY(50%);}&::before{top:50%;bottom:50%;left:-7px;margin-top:-6px;border-left-color:", ";}}&.tooltipped-e{&::after{bottom:50%;left:100%;margin-left:6px;transform:translateY(50%);}&::before{top:50%;right:-7px;bottom:50%;margin-top:-6px;border-right-color:", ";}}&.tooltipped-multiline{&::after{width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}&.tooltipped-s::after,&.tooltipped-n::after{right:auto;left:50%;transform:translateX(-50%);}&.tooltipped-w::after,&.tooltipped-e::after{right:100%;}}&.tooltipped-align-right-2::after{right:0;margin-right:0;}&.tooltipped-align-right-2::before{right:15px;}&.tooltipped-align-left-2::after{left:0;margin-left:0;}&.tooltipped-align-left-2::before{left:10px;}", ";"], get('colors.neutral.emphasisPlus'), get('fonts.normal'), get('colors.fg.onEmphasis'), get('colors.neutral.emphasisPlus'), get('radii.1'), get('colors.neutral.emphasisPlus'), get('space.3'), get('space.3'), get('colors.neutral.emphasisPlus'), get('space.3'), get('space.3'), get('colors.neutral.emphasisPlus'), get('colors.neutral.emphasisPlus'), sx);
|
|
12
12
|
|
|
13
13
|
function Tooltip({
|
|
14
14
|
direction = 'n',
|
package/lib-esm/Truncate.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { MaxWidthProps } from 'styled-system';
|
|
2
|
-
import { SystemCommonProps, SystemTypographyProps } from './constants';
|
|
3
2
|
import { SxProp } from './sx';
|
|
4
3
|
import { ComponentProps } from './utils/types';
|
|
5
4
|
declare const Truncate: import("styled-components").StyledComponent<"div", any, {
|
|
6
5
|
title: string;
|
|
7
6
|
inline?: boolean | undefined;
|
|
8
7
|
expandable?: boolean | undefined;
|
|
9
|
-
} & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> &
|
|
8
|
+
} & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
|
|
10
9
|
export declare type TruncateProps = ComponentProps<typeof Truncate>;
|
|
11
10
|
export default Truncate;
|
package/lib-esm/Truncate.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { maxWidth } from 'styled-system';
|
|
3
|
-
import { COMMON, TYPOGRAPHY } from './constants';
|
|
4
3
|
import sx from './sx';
|
|
5
4
|
const Truncate = styled.div.withConfig({
|
|
6
5
|
displayName: "Truncate",
|
|
7
6
|
componentId: "sc-1074h1l-0"
|
|
8
|
-
})(["
|
|
7
|
+
})(["display:", ";overflow:hidden;text-overflow:ellipsis;vertical-align:", ";white-space:nowrap;", " ", " ", ";"], props => props.inline ? 'inline-block' : 'inherit', props => props.inline ? 'top' : 'initial', maxWidth, props => props.expandable ? `&:hover { max-width: 10000px; }` : '', sx);
|
|
9
8
|
Truncate.defaultProps = {
|
|
10
9
|
expandable: false,
|
|
11
10
|
inline: false,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as History from 'history';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { SystemCommonProps } from './constants';
|
|
4
3
|
import { SxProp } from './sx';
|
|
5
4
|
import { ComponentProps } from './utils/types';
|
|
6
5
|
declare const UnderlineNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
|
@@ -14,12 +13,12 @@ declare function UnderlineNav({ actions, className, align, children, full, label
|
|
|
14
13
|
declare const UnderlineNavLink: import("styled-components").StyledComponent<"a", any, {
|
|
15
14
|
to?: History.LocationDescriptor<unknown> | undefined;
|
|
16
15
|
selected?: boolean | undefined;
|
|
17
|
-
} &
|
|
16
|
+
} & SxProp, never>;
|
|
18
17
|
export declare type UnderlineNavLinkProps = ComponentProps<typeof UnderlineNavLink>;
|
|
19
18
|
declare const _default: typeof UnderlineNav & {
|
|
20
19
|
Link: import("styled-components").StyledComponent<"a", any, {
|
|
21
20
|
to?: History.LocationDescriptor<unknown> | undefined;
|
|
22
21
|
selected?: boolean | undefined;
|
|
23
|
-
} &
|
|
22
|
+
} & SxProp, never>;
|
|
24
23
|
};
|
|
25
24
|
export default _default;
|
package/lib-esm/UnderlineNav.js
CHANGED
|
@@ -4,14 +4,14 @@ import classnames from 'classnames'; // eslint-disable-next-line import/no-names
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import {
|
|
7
|
+
import { get } from './constants';
|
|
8
8
|
import sx from './sx';
|
|
9
9
|
const ITEM_CLASS = 'UnderlineNav-item';
|
|
10
10
|
const SELECTED_CLASS = 'selected';
|
|
11
11
|
const UnderlineNavBase = styled.nav.withConfig({
|
|
12
12
|
displayName: "UnderlineNav__UnderlineNavBase",
|
|
13
13
|
componentId: "zrnxqt-0"
|
|
14
|
-
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";"
|
|
14
|
+
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";"], get('colors.border.muted'), get('space.3'), sx);
|
|
15
15
|
|
|
16
16
|
function UnderlineNav({
|
|
17
17
|
actions,
|
|
@@ -42,7 +42,7 @@ const UnderlineNavLink = styled.a.attrs(props => ({
|
|
|
42
42
|
})).withConfig({
|
|
43
43
|
displayName: "UnderlineNav__UnderlineNavLink",
|
|
44
44
|
componentId: "zrnxqt-1"
|
|
45
|
-
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";"
|
|
45
|
+
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";"], get('space.3'), get('space.2'), get('space.3'), get('fontSizes.1'), get('lineHeights.default'), get('colors.fg.default'), get('colors.fg.default'), get('colors.neutral.muted'), get('colors.fg.muted'), get('colors.fg.default'), get('colors.primer.border.active'), get('colors.fg.default'), sx);
|
|
46
46
|
UnderlineNavLink.displayName = 'UnderlineNav.Link';
|
|
47
47
|
export default Object.assign(UnderlineNav, {
|
|
48
48
|
Link: UnderlineNavLink
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -115,6 +115,4 @@ export { default as Truncate } from './Truncate';
|
|
|
115
115
|
export type { TruncateProps } from './Truncate';
|
|
116
116
|
export { default as UnderlineNav } from './UnderlineNav';
|
|
117
117
|
export type { UnderlineNavProps, UnderlineNavLinkProps } from './UnderlineNav';
|
|
118
|
-
export { default as Checkbox } from './Checkbox';
|
|
119
|
-
export type { CheckboxProps } from './Checkbox';
|
|
120
118
|
export { SSRProvider, useSSRSafeId } from './utils/ssr';
|
package/lib-esm/index.js
CHANGED
|
@@ -70,5 +70,4 @@ export { default as Token, IssueLabelToken, AvatarToken } from './Token';
|
|
|
70
70
|
export { default as Tooltip } from './Tooltip';
|
|
71
71
|
export { default as Truncate } from './Truncate';
|
|
72
72
|
export { default as UnderlineNav } from './UnderlineNav';
|
|
73
|
-
export { default as Checkbox } from './Checkbox';
|
|
74
73
|
export { SSRProvider, useSSRSafeId } from './utils/ssr';
|
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-2021102321921",
|
|
4
4
|
"description": "Primer react components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"eslint-plugin-jsx-a11y": "6.4.1",
|
|
115
115
|
"eslint-plugin-mdx": "1.15.1",
|
|
116
116
|
"eslint-plugin-prettier": "3.4.0",
|
|
117
|
-
"eslint-plugin-primer-react": "0.
|
|
117
|
+
"eslint-plugin-primer-react": "0.7.0",
|
|
118
118
|
"eslint-plugin-react": "7.24.0",
|
|
119
119
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
120
120
|
"jest": "27.0.4",
|
package/lib/Checkbox.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
-
import { SxProp } from './sx';
|
|
3
|
-
export declare type CheckboxProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Apply indeterminate visual appearance to the checkbox
|
|
6
|
-
*/
|
|
7
|
-
indeterminate?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Apply inactive visual appearance to the checkbox
|
|
10
|
-
*/
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Forward a ref to the underlying input element
|
|
14
|
-
*/
|
|
15
|
-
ref?: React.RefObject<HTMLInputElement>;
|
|
16
|
-
/**
|
|
17
|
-
* Indicates whether the checkbox must be checked
|
|
18
|
-
*/
|
|
19
|
-
required?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Indicates whether the checkbox validation state
|
|
22
|
-
*/
|
|
23
|
-
validationStatus?: 'error' | 'success';
|
|
24
|
-
} & InputHTMLAttributes<HTMLInputElement> & SxProp;
|
|
25
|
-
/**
|
|
26
|
-
* An accessible, native checkbox component
|
|
27
|
-
*/
|
|
28
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "indeterminate" | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
-
export default Checkbox;
|
package/lib/Checkbox.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _sx = _interopRequireDefault(require("./sx"));
|
|
13
|
-
|
|
14
|
-
var _constants = require("./constants");
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
const StyledCheckbox = _styledComponents.default.input.withConfig({
|
|
25
|
-
displayName: "Checkbox__StyledCheckbox",
|
|
26
|
-
componentId: "i51804-0"
|
|
27
|
-
})(["cursor:pointer;", " ", ";", ""], props => props.disabled && `cursor: not-allowed;`, _constants.COMMON, _sx.default);
|
|
28
|
-
/**
|
|
29
|
-
* An accessible, native checkbox component
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const Checkbox = /*#__PURE__*/_react.default.forwardRef(({
|
|
34
|
-
checked,
|
|
35
|
-
indeterminate,
|
|
36
|
-
disabled,
|
|
37
|
-
sx: sxProp,
|
|
38
|
-
required,
|
|
39
|
-
validationStatus,
|
|
40
|
-
...rest
|
|
41
|
-
}, ref) => {
|
|
42
|
-
const checkboxRef = (0, _react.useRef)(null);
|
|
43
|
-
(0, _react.useLayoutEffect)(() => {
|
|
44
|
-
if (checkboxRef.current) {
|
|
45
|
-
checkboxRef.current.indeterminate = indeterminate || false;
|
|
46
|
-
}
|
|
47
|
-
}, [indeterminate, checked]);
|
|
48
|
-
return /*#__PURE__*/_react.default.createElement(StyledCheckbox, _extends({
|
|
49
|
-
type: "checkbox",
|
|
50
|
-
disabled: disabled,
|
|
51
|
-
"aria-disabled": disabled ? 'true' : 'false',
|
|
52
|
-
ref: ref || checkboxRef,
|
|
53
|
-
checked: indeterminate ? false : checked,
|
|
54
|
-
"aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false',
|
|
55
|
-
sx: { ...sxProp
|
|
56
|
-
},
|
|
57
|
-
required: required,
|
|
58
|
-
"aria-required": required ? 'true' : 'false',
|
|
59
|
-
"aria-invalid": validationStatus === 'error' ? 'true' : 'false'
|
|
60
|
-
}, rest));
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
Checkbox.displayName = 'Checkbox';
|
|
64
|
-
var _default = Checkbox;
|
|
65
|
-
exports.default = _default;
|
package/lib/Checkbox.jsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
26
|
-
const react_1 = __importStar(require("react"));
|
|
27
|
-
const sx_1 = __importDefault(require("./sx"));
|
|
28
|
-
const constants_1 = require("./constants");
|
|
29
|
-
const StyledCheckbox = styled_components_1.default.input `
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
|
|
32
|
-
${props => props.disabled && `cursor: not-allowed;`}
|
|
33
|
-
|
|
34
|
-
${constants_1.COMMON};
|
|
35
|
-
${sx_1.default}
|
|
36
|
-
`;
|
|
37
|
-
/**
|
|
38
|
-
* An accessible, native checkbox component
|
|
39
|
-
*/
|
|
40
|
-
const Checkbox = react_1.default.forwardRef(({ checked, indeterminate, disabled, sx: sxProp, required, validationStatus, ...rest }, ref) => {
|
|
41
|
-
const checkboxRef = react_1.useRef(null);
|
|
42
|
-
react_1.useLayoutEffect(() => {
|
|
43
|
-
if (checkboxRef.current) {
|
|
44
|
-
checkboxRef.current.indeterminate = indeterminate || false;
|
|
45
|
-
}
|
|
46
|
-
}, [indeterminate, checked]);
|
|
47
|
-
return (<StyledCheckbox type="checkbox" disabled={disabled} aria-disabled={disabled ? 'true' : 'false'} ref={ref || checkboxRef} checked={indeterminate ? false : checked} aria-checked={indeterminate ? 'mixed' : checked ? 'true' : 'false'} sx={{ ...sxProp }} required={required} aria-required={required ? 'true' : 'false'} aria-invalid={validationStatus === 'error' ? 'true' : 'false'} {...rest}/>);
|
|
48
|
-
});
|
|
49
|
-
Checkbox.displayName = 'Checkbox';
|
|
50
|
-
exports.default = Checkbox;
|
package/lib-esm/Checkbox.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
-
import { SxProp } from './sx';
|
|
3
|
-
export declare type CheckboxProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Apply indeterminate visual appearance to the checkbox
|
|
6
|
-
*/
|
|
7
|
-
indeterminate?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Apply inactive visual appearance to the checkbox
|
|
10
|
-
*/
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Forward a ref to the underlying input element
|
|
14
|
-
*/
|
|
15
|
-
ref?: React.RefObject<HTMLInputElement>;
|
|
16
|
-
/**
|
|
17
|
-
* Indicates whether the checkbox must be checked
|
|
18
|
-
*/
|
|
19
|
-
required?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Indicates whether the checkbox validation state
|
|
22
|
-
*/
|
|
23
|
-
validationStatus?: 'error' | 'success';
|
|
24
|
-
} & InputHTMLAttributes<HTMLInputElement> & SxProp;
|
|
25
|
-
/**
|
|
26
|
-
* An accessible, native checkbox component
|
|
27
|
-
*/
|
|
28
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "indeterminate" | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
-
export default Checkbox;
|
package/lib-esm/Checkbox.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
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 styled from 'styled-components';
|
|
4
|
-
import React, { useLayoutEffect, useRef } from 'react';
|
|
5
|
-
import sx from './sx';
|
|
6
|
-
import { COMMON } from './constants';
|
|
7
|
-
const StyledCheckbox = styled.input.withConfig({
|
|
8
|
-
displayName: "Checkbox__StyledCheckbox",
|
|
9
|
-
componentId: "i51804-0"
|
|
10
|
-
})(["cursor:pointer;", " ", ";", ""], props => props.disabled && `cursor: not-allowed;`, COMMON, sx);
|
|
11
|
-
/**
|
|
12
|
-
* An accessible, native checkbox component
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
16
|
-
checked,
|
|
17
|
-
indeterminate,
|
|
18
|
-
disabled,
|
|
19
|
-
sx: sxProp,
|
|
20
|
-
required,
|
|
21
|
-
validationStatus,
|
|
22
|
-
...rest
|
|
23
|
-
}, ref) => {
|
|
24
|
-
const checkboxRef = useRef(null);
|
|
25
|
-
useLayoutEffect(() => {
|
|
26
|
-
if (checkboxRef.current) {
|
|
27
|
-
checkboxRef.current.indeterminate = indeterminate || false;
|
|
28
|
-
}
|
|
29
|
-
}, [indeterminate, checked]);
|
|
30
|
-
return /*#__PURE__*/React.createElement(StyledCheckbox, _extends({
|
|
31
|
-
type: "checkbox",
|
|
32
|
-
disabled: disabled,
|
|
33
|
-
"aria-disabled": disabled ? 'true' : 'false',
|
|
34
|
-
ref: ref || checkboxRef,
|
|
35
|
-
checked: indeterminate ? false : checked,
|
|
36
|
-
"aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false',
|
|
37
|
-
sx: { ...sxProp
|
|
38
|
-
},
|
|
39
|
-
required: required,
|
|
40
|
-
"aria-required": required ? 'true' : 'false',
|
|
41
|
-
"aria-invalid": validationStatus === 'error' ? 'true' : 'false'
|
|
42
|
-
}, rest));
|
|
43
|
-
});
|
|
44
|
-
Checkbox.displayName = 'Checkbox';
|
|
45
|
-
export default Checkbox;
|