@primer/components 0.0.0-2021919202426 → 0.0.0-2021920152952
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 -19
- package/codemods/deprecateUtilityComponents.js +1 -1
- package/dist/browser.esm.js +768 -879
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +773 -884
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Item.js +4 -4
- package/lib/ActionList/List.d.ts +1 -2
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
- package/lib/AnchoredOverlay/AnchoredOverlay.js +3 -11
- package/lib/BaseStyles.js +1 -1
- package/lib/BorderBox.js +1 -1
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonInvisible.js +1 -1
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Caret.js +2 -2
- package/lib/DatePicker/DatePicker.d.ts +47 -0
- package/lib/DatePicker/DatePicker.js +76 -0
- package/lib/DatePicker/DatePickerAnchor.d.ts +10 -0
- package/lib/DatePicker/DatePickerAnchor.js +83 -0
- package/lib/DatePicker/DatePickerPanel.d.ts +2 -0
- package/lib/DatePicker/DatePickerPanel.js +38 -0
- package/lib/DatePicker/Day.d.ts +13 -0
- package/lib/DatePicker/Day.js +136 -0
- package/lib/DatePicker/Month.d.ts +9 -0
- package/lib/DatePicker/Month.js +97 -0
- package/lib/DatePicker/index.d.ts +2 -0
- package/lib/DatePicker/index.js +13 -0
- package/lib/DatePicker/useDatePicker.d.ts +51 -0
- package/lib/DatePicker/useDatePicker.js +133 -0
- package/lib/Dialog.js +1 -1
- package/lib/FilteredActionList/FilteredActionList.js +31 -5
- package/lib/Flash.js +16 -16
- package/lib/Label.js +1 -1
- package/lib/Overlay.d.ts +0 -1
- package/lib/Overlay.js +1 -3
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +10 -10
- package/lib/StateLabel.js +19 -13
- package/lib/TextInput.d.ts +13 -5
- package/lib/TextInput.js +46 -4
- package/lib/hooks/useOpenAndCloseFocus.d.ts +1 -2
- package/lib/hooks/useOpenAndCloseFocus.js +2 -7
- package/lib/hooks/useOverlay.d.ts +1 -2
- package/lib/hooks/useOverlay.js +2 -4
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -36
- package/lib/theme-preval.js +3105 -375
- package/lib/utils/testing.d.ts +493 -50
- package/{lib-esm/utils/types/AriaRole.d.ts → lib/utils/types.d.ts} +13 -0
- package/lib/utils/{types/AriaRole.js → types.js} +0 -0
- package/lib-esm/ActionList/Item.js +4 -4
- package/lib-esm/ActionList/List.d.ts +1 -2
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +3 -11
- package/lib-esm/BaseStyles.js +1 -1
- package/lib-esm/BorderBox.js +1 -1
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/Caret.js +2 -2
- package/lib-esm/DatePicker/DatePicker.d.ts +47 -0
- package/lib-esm/DatePicker/DatePicker.js +57 -0
- package/lib-esm/DatePicker/DatePickerAnchor.d.ts +10 -0
- package/lib-esm/DatePicker/DatePickerAnchor.js +59 -0
- package/lib-esm/DatePicker/DatePickerPanel.d.ts +2 -0
- package/lib-esm/DatePicker/DatePickerPanel.js +20 -0
- package/lib-esm/DatePicker/Day.d.ts +13 -0
- package/lib-esm/DatePicker/Day.js +113 -0
- package/lib-esm/DatePicker/Month.d.ts +9 -0
- package/lib-esm/DatePicker/Month.js +74 -0
- package/lib-esm/DatePicker/index.d.ts +2 -0
- package/lib-esm/DatePicker/index.js +1 -0
- package/lib-esm/DatePicker/useDatePicker.d.ts +51 -0
- package/lib-esm/DatePicker/useDatePicker.js +114 -0
- package/lib-esm/Dialog.js +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.js +31 -3
- package/lib-esm/Flash.js +16 -16
- package/lib-esm/Label.js +1 -1
- package/lib-esm/Overlay.d.ts +0 -1
- package/lib-esm/Overlay.js +1 -3
- package/lib-esm/Pagination/Pagination.js +1 -1
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +10 -10
- package/lib-esm/StateLabel.js +19 -13
- package/lib-esm/TextInput.d.ts +13 -5
- package/lib-esm/TextInput.js +37 -4
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +1 -2
- package/lib-esm/hooks/useOpenAndCloseFocus.js +2 -7
- package/lib-esm/hooks/useOverlay.d.ts +1 -2
- package/lib-esm/hooks/useOverlay.js +2 -4
- package/lib-esm/index.d.ts +0 -5
- package/lib-esm/index.js +0 -3
- package/lib-esm/theme-preval.js +3105 -375
- package/lib-esm/utils/testing.d.ts +493 -50
- package/{lib/utils/types/AriaRole.d.ts → lib-esm/utils/types.d.ts} +13 -0
- package/lib-esm/utils/{types/AriaRole.js → types.js} +0 -0
- package/package.json +4 -4
- package/lib/Autocomplete/Autocomplete.d.ts +0 -304
- package/lib/Autocomplete/Autocomplete.js +0 -145
- package/lib/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteContext.js +0 -11
- package/lib/Autocomplete/AutocompleteInput.d.ts +0 -292
- package/lib/Autocomplete/AutocompleteInput.js +0 -157
- package/lib/Autocomplete/AutocompleteMenu.d.ts +0 -72
- package/lib/Autocomplete/AutocompleteMenu.js +0 -224
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +0 -20
- package/lib/Autocomplete/AutocompleteOverlay.js +0 -80
- package/lib/Autocomplete/index.d.ts +0 -2
- package/lib/Autocomplete/index.js +0 -15
- package/lib/TextInputWithTokens.d.ts +0 -327
- package/lib/TextInputWithTokens.js +0 -298
- package/lib/Token/AvatarToken.d.ts +0 -7
- package/lib/Token/AvatarToken.js +0 -64
- package/lib/Token/IssueLabelToken.d.ts +0 -14
- package/lib/Token/IssueLabelToken.js +0 -144
- package/lib/Token/Token.d.ts +0 -15
- package/lib/Token/Token.js +0 -94
- package/lib/Token/TokenBase.d.ts +0 -31
- package/lib/Token/TokenBase.js +0 -108
- package/lib/Token/_RemoveTokenButton.d.ts +0 -12
- package/lib/Token/_RemoveTokenButton.js +0 -77
- package/lib/Token/_TokenTextContainer.d.ts +0 -3
- package/lib/Token/_TokenTextContainer.js +0 -17
- package/lib/Token/index.d.ts +0 -3
- package/lib/Token/index.js +0 -31
- package/lib/_TextInputWrapper.d.ts +0 -10
- package/lib/_TextInputWrapper.js +0 -51
- package/lib/_UnstyledTextInput.d.ts +0 -2
- package/lib/_UnstyledTextInput.js +0 -20
- package/lib/behaviors/scrollIntoViewingArea.d.ts +0 -1
- package/lib/behaviors/scrollIntoViewingArea.js +0 -39
- package/lib/utils/types/ComponentProps.d.ts +0 -9
- package/lib/utils/types/ComponentProps.js +0 -1
- package/lib/utils/types/Flatten.d.ts +0 -4
- package/lib/utils/types/Flatten.js +0 -1
- package/lib/utils/types/MandateProps.d.ts +0 -3
- package/lib/utils/types/MandateProps.js +0 -1
- package/lib/utils/types/Merge.d.ts +0 -19
- package/lib/utils/types/Merge.js +0 -1
- package/lib/utils/types/index.d.ts +0 -5
- package/lib/utils/types/index.js +0 -70
- package/lib-esm/Autocomplete/Autocomplete.d.ts +0 -304
- package/lib-esm/Autocomplete/Autocomplete.js +0 -123
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteContext.js +0 -2
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +0 -292
- package/lib-esm/Autocomplete/AutocompleteInput.js +0 -138
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +0 -72
- package/lib-esm/Autocomplete/AutocompleteMenu.js +0 -205
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +0 -20
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +0 -62
- package/lib-esm/Autocomplete/index.d.ts +0 -2
- package/lib-esm/Autocomplete/index.js +0 -1
- package/lib-esm/TextInputWithTokens.d.ts +0 -327
- package/lib-esm/TextInputWithTokens.js +0 -272
- package/lib-esm/Token/AvatarToken.d.ts +0 -7
- package/lib-esm/Token/AvatarToken.js +0 -43
- package/lib-esm/Token/IssueLabelToken.d.ts +0 -14
- package/lib-esm/Token/IssueLabelToken.js +0 -124
- package/lib-esm/Token/Token.d.ts +0 -15
- package/lib-esm/Token/Token.js +0 -73
- package/lib-esm/Token/TokenBase.d.ts +0 -31
- package/lib-esm/Token/TokenBase.js +0 -87
- package/lib-esm/Token/_RemoveTokenButton.d.ts +0 -12
- package/lib-esm/Token/_RemoveTokenButton.js +0 -60
- package/lib-esm/Token/_TokenTextContainer.d.ts +0 -3
- package/lib-esm/Token/_TokenTextContainer.js +0 -6
- package/lib-esm/Token/index.d.ts +0 -3
- package/lib-esm/Token/index.js +0 -3
- package/lib-esm/_TextInputWrapper.d.ts +0 -10
- package/lib-esm/_TextInputWrapper.js +0 -31
- package/lib-esm/_UnstyledTextInput.d.ts +0 -2
- package/lib-esm/_UnstyledTextInput.js +0 -7
- package/lib-esm/behaviors/scrollIntoViewingArea.d.ts +0 -1
- package/lib-esm/behaviors/scrollIntoViewingArea.js +0 -30
- package/lib-esm/utils/types/ComponentProps.d.ts +0 -9
- package/lib-esm/utils/types/ComponentProps.js +0 -1
- package/lib-esm/utils/types/Flatten.d.ts +0 -4
- package/lib-esm/utils/types/Flatten.js +0 -1
- package/lib-esm/utils/types/MandateProps.d.ts +0 -3
- package/lib-esm/utils/types/MandateProps.js +0 -1
- package/lib-esm/utils/types/Merge.d.ts +0 -19
- package/lib-esm/utils/types/Merge.js +0 -1
- package/lib-esm/utils/types/index.d.ts +0 -5
- package/lib-esm/utils/types/index.js +0 -5
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Month = void 0;
|
|
7
|
+
|
|
8
|
+
var _dateFns = require("date-fns");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _Box = _interopRequireDefault(require("../Box"));
|
|
15
|
+
|
|
16
|
+
var _Text = _interopRequireDefault(require("../Text"));
|
|
17
|
+
|
|
18
|
+
var _constants = require("../constants");
|
|
19
|
+
|
|
20
|
+
var _Day = require("./Day");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
const MonthComponent = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
29
|
+
displayName: "Month__MonthComponent",
|
|
30
|
+
componentId: "l6j7o0-0"
|
|
31
|
+
})(["display:grid;grid-auto-rows:min-content;grid-template-columns:repeat(1fr,7);grid-template-rows:1fr;gap:0px 0px;grid-template-areas:'month month month month month month month' 'sunday monday tuesday wednesday thursday friday saturday';justify-items:stretch;align-items:stretch;"]);
|
|
32
|
+
const MonthTitle = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
33
|
+
displayName: "Month__MonthTitle",
|
|
34
|
+
componentId: "l6j7o0-1"
|
|
35
|
+
})(["font-size:", ";font-weight:", ";grid-area:month;justify-self:center;"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('fontWeights.bold'));
|
|
36
|
+
const WeekdayHeader = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
37
|
+
displayName: "Month__WeekdayHeader",
|
|
38
|
+
componentId: "l6j7o0-2"
|
|
39
|
+
})(["color:", ";font-family:", ";font-size:", ";justify-self:center;padding:", " 0 ", ";"], (0, _constants.get)('colors.fg.subtle'), (0, _constants.get)('fonts.mono'), (0, _constants.get)('fontSizes.0'), (0, _constants.get)('space.3'), (0, _constants.get)('space.2'));
|
|
40
|
+
|
|
41
|
+
const Month = ({
|
|
42
|
+
month,
|
|
43
|
+
year
|
|
44
|
+
}) => {
|
|
45
|
+
const [selectedDay, setSelectedDay] = (0, _react.useState)(null);
|
|
46
|
+
const getTitle = (0, _react.useMemo)(() => `${(0, _dateFns.format)(new Date(year, month), 'MMMM yyyy')}`, [month, year]);
|
|
47
|
+
const weekdayHeaders = (0, _react.useMemo)(() => {
|
|
48
|
+
const now = new Date(year, month);
|
|
49
|
+
return (0, _dateFns.eachDayOfInterval)({
|
|
50
|
+
start: (0, _dateFns.startOfWeek)(now),
|
|
51
|
+
end: (0, _dateFns.endOfWeek)(now)
|
|
52
|
+
}).map(d => /*#__PURE__*/_react.default.createElement(WeekdayHeader, {
|
|
53
|
+
key: `weekday-${d}-header`
|
|
54
|
+
}, (0, _dateFns.format)(d, 'EEEEEE')));
|
|
55
|
+
}, [month, year]);
|
|
56
|
+
|
|
57
|
+
const dayAction = date => {
|
|
58
|
+
setSelectedDay(date);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const dayComponents = (0, _react.useMemo)(() => {
|
|
62
|
+
const components = [];
|
|
63
|
+
const firstDay = new Date(year, month, 1);
|
|
64
|
+
|
|
65
|
+
for (let i = 0; i < firstDay.getDay(); i++) {
|
|
66
|
+
components.push( /*#__PURE__*/_react.default.createElement(_Day.BlankDay, {
|
|
67
|
+
key: `month-pre-blank-${i}`
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
for (let i = 1; i <= (0, _dateFns.getDaysInMonth)(firstDay); i++) {
|
|
72
|
+
const date = new Date(year, month, i);
|
|
73
|
+
components.push( /*#__PURE__*/_react.default.createElement(_Day.Day, {
|
|
74
|
+
key: `day-component-${date.toString()}`,
|
|
75
|
+
date: date,
|
|
76
|
+
selected: selectedDay ? (0, _dateFns.isEqual)(date, selectedDay) : false,
|
|
77
|
+
onAction: dayAction
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const lastDay = (0, _dateFns.lastDayOfMonth)(firstDay);
|
|
82
|
+
|
|
83
|
+
for (let i = 6; i > lastDay.getDay(); i--) {
|
|
84
|
+
components.push( /*#__PURE__*/_react.default.createElement(_Day.BlankDay, {
|
|
85
|
+
key: `month-post-blank-${i}`
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return components;
|
|
90
|
+
}, [month, selectedDay, year]);
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(MonthComponent, {
|
|
92
|
+
role: "grid"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(MonthTitle, null, getTitle), weekdayHeaders, dayComponents);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
exports.Month = Month;
|
|
97
|
+
Month.displayName = "Month";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "DatePicker", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _DatePicker.DatePicker;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _DatePicker = require("./DatePicker");
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DatePickerConfiguration {
|
|
3
|
+
anchorStyle?: 'input' | 'full-date' | 'icon-only';
|
|
4
|
+
blockedDates?: Array<Date>;
|
|
5
|
+
confirmation?: boolean;
|
|
6
|
+
contiguousSelection?: boolean;
|
|
7
|
+
dimWeekends?: boolean;
|
|
8
|
+
minDate?: Date;
|
|
9
|
+
maxDate?: Date;
|
|
10
|
+
rangeIncrement?: number;
|
|
11
|
+
selection?: 'single' | 'multi' | 'range';
|
|
12
|
+
view?: '1-month' | '2-month';
|
|
13
|
+
}
|
|
14
|
+
declare type SingleSelection = {
|
|
15
|
+
date: Date;
|
|
16
|
+
};
|
|
17
|
+
declare type BaseRangeSelection = {
|
|
18
|
+
from: Date;
|
|
19
|
+
};
|
|
20
|
+
declare type RangeSelection = {
|
|
21
|
+
to: Date;
|
|
22
|
+
} & BaseRangeSelection;
|
|
23
|
+
declare type SoftRangeSelection = {
|
|
24
|
+
to?: Date;
|
|
25
|
+
} & BaseRangeSelection;
|
|
26
|
+
export interface DatePickerContext {
|
|
27
|
+
configuration: DatePickerConfiguration;
|
|
28
|
+
selection?: SingleSelection | Array<SingleSelection> | RangeSelection | null;
|
|
29
|
+
softSelection?: SingleSelection | SoftRangeSelection | null;
|
|
30
|
+
selectionActive?: boolean;
|
|
31
|
+
onSelection: (date: Date) => void;
|
|
32
|
+
onDayFocus: (date: Date) => void;
|
|
33
|
+
onDayBlur: () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const useDatePicker: (date?: Date | undefined) => {
|
|
36
|
+
blocked: boolean | undefined;
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
selected: boolean | undefined;
|
|
39
|
+
configuration: DatePickerConfiguration;
|
|
40
|
+
selection?: SingleSelection | RangeSelection | SingleSelection[] | null | undefined;
|
|
41
|
+
softSelection?: SingleSelection | SoftRangeSelection | null | undefined;
|
|
42
|
+
selectionActive?: boolean | undefined;
|
|
43
|
+
onSelection: (date: Date) => void;
|
|
44
|
+
onDayFocus: (date: Date) => void;
|
|
45
|
+
onDayBlur: () => void;
|
|
46
|
+
};
|
|
47
|
+
export interface DatePickerProviderProps {
|
|
48
|
+
configuration?: DatePickerConfiguration;
|
|
49
|
+
}
|
|
50
|
+
export declare const DatePickerProvider: React.FC<DatePickerProviderProps>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DatePickerProvider = exports.useDatePicker = void 0;
|
|
7
|
+
|
|
8
|
+
var _dateFns = require("date-fns");
|
|
9
|
+
|
|
10
|
+
var _esm = require("date-fns/esm");
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
const DatePickerContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
19
|
+
|
|
20
|
+
const useDatePicker = date => {
|
|
21
|
+
const value = (0, _react.useContext)(DatePickerContext);
|
|
22
|
+
|
|
23
|
+
if (!value) {
|
|
24
|
+
throw new Error('useDatePicker must be used inside a DatePickerProvider');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let selected,
|
|
28
|
+
blocked,
|
|
29
|
+
disabled = false;
|
|
30
|
+
|
|
31
|
+
if (date) {
|
|
32
|
+
if (Array.isArray(value.selection)) {
|
|
33
|
+
selected = !!value.selection.find(d => (0, _dateFns.isEqual)(d.date, date));
|
|
34
|
+
} // Determine if date is blocked out
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if (value.configuration.blockedDates) {
|
|
38
|
+
blocked = !!value.configuration.blockedDates.find(d => (0, _dateFns.isEqual)(d, date));
|
|
39
|
+
} // Determine if date is disabled
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if (value.configuration.minDate || value.configuration.maxDate) {
|
|
43
|
+
disabled = (value.configuration.minDate ? (0, _esm.isBefore)(date, value.configuration.minDate) : false) || (value.configuration.maxDate ? (0, _esm.isAfter)(date, value.configuration.maxDate) : false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return { ...value,
|
|
48
|
+
blocked,
|
|
49
|
+
disabled,
|
|
50
|
+
selected
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.useDatePicker = useDatePicker;
|
|
55
|
+
|
|
56
|
+
function isRangeSelection(selection) {
|
|
57
|
+
return !!selection.from;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const DatePickerProvider = ({
|
|
61
|
+
configuration,
|
|
62
|
+
children
|
|
63
|
+
}) => {
|
|
64
|
+
const [selection, setSelection] = (0, _react.useState)(null);
|
|
65
|
+
const [softSelection, setSoftSelection] = (0, _react.useState)(null);
|
|
66
|
+
const selectionHandler = (0, _react.useCallback)(date => {
|
|
67
|
+
if ((configuration === null || configuration === void 0 ? void 0 : configuration.selection) === 'single') {
|
|
68
|
+
setSelection({
|
|
69
|
+
date
|
|
70
|
+
});
|
|
71
|
+
} else if ((configuration === null || configuration === void 0 ? void 0 : configuration.selection) === 'range') {
|
|
72
|
+
if (softSelection && isRangeSelection(softSelection)) {
|
|
73
|
+
setSelection({
|
|
74
|
+
from: softSelection.from,
|
|
75
|
+
to: date
|
|
76
|
+
});
|
|
77
|
+
} else {
|
|
78
|
+
setSoftSelection({
|
|
79
|
+
from: date,
|
|
80
|
+
to: date
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, [configuration === null || configuration === void 0 ? void 0 : configuration.selection, softSelection]);
|
|
85
|
+
const focusHnadler = (0, _react.useCallback)(date => {
|
|
86
|
+
if ((configuration === null || configuration === void 0 ? void 0 : configuration.selection) === 'single' || !softSelection) {
|
|
87
|
+
setSoftSelection({
|
|
88
|
+
date
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if ((configuration === null || configuration === void 0 ? void 0 : configuration.selection) === 'range' && softSelection && isRangeSelection(softSelection)) {
|
|
93
|
+
setSoftSelection({ ...softSelection,
|
|
94
|
+
to: date
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}, [configuration === null || configuration === void 0 ? void 0 : configuration.selection, softSelection]);
|
|
98
|
+
const blurHnadler = (0, _react.useCallback)(() => {
|
|
99
|
+
if ((configuration === null || configuration === void 0 ? void 0 : configuration.selection) === 'single' || !softSelection) {
|
|
100
|
+
setSoftSelection(null);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if ((configuration === null || configuration === void 0 ? void 0 : configuration.selection) === 'range' && softSelection && isRangeSelection(softSelection)) {
|
|
104
|
+
setSoftSelection({
|
|
105
|
+
from: softSelection.from
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}, [configuration === null || configuration === void 0 ? void 0 : configuration.selection, softSelection]);
|
|
109
|
+
const datePickerCtx = (0, _react.useMemo)(() => {
|
|
110
|
+
return {
|
|
111
|
+
configuration: {
|
|
112
|
+
anchorStyle: 'full-date',
|
|
113
|
+
confirmation: false,
|
|
114
|
+
contiguousSelection: false,
|
|
115
|
+
dimWeekends: false,
|
|
116
|
+
selection: 'single',
|
|
117
|
+
view: '2-month',
|
|
118
|
+
...configuration
|
|
119
|
+
},
|
|
120
|
+
selectionActive: false,
|
|
121
|
+
selection,
|
|
122
|
+
onSelection: selectionHandler,
|
|
123
|
+
onDayFocus: focusHnadler,
|
|
124
|
+
onDayBlur: blurHnadler
|
|
125
|
+
};
|
|
126
|
+
}, [blurHnadler, configuration, focusHnadler, selection, selectionHandler]);
|
|
127
|
+
return /*#__PURE__*/_react.default.createElement(DatePickerContext.Provider, {
|
|
128
|
+
value: datePickerCtx
|
|
129
|
+
}, children);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
exports.DatePickerProvider = DatePickerProvider;
|
|
133
|
+
DatePickerProvider.displayName = "DatePickerProvider";
|
package/lib/Dialog.js
CHANGED
|
@@ -122,7 +122,7 @@ const Dialog = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
122
122
|
}), children)) : null;
|
|
123
123
|
});
|
|
124
124
|
DialogHeader.defaultProps = {
|
|
125
|
-
backgroundColor: '
|
|
125
|
+
backgroundColor: 'bg.tertiary'
|
|
126
126
|
};
|
|
127
127
|
DialogHeader.propTypes = { ..._Box.default.propTypes
|
|
128
128
|
};
|
|
@@ -7,8 +7,6 @@ exports.FilteredActionList = FilteredActionList;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var _ssr = require("@react-aria/ssr");
|
|
11
|
-
|
|
12
10
|
var _TextInput = _interopRequireDefault(require("../TextInput"));
|
|
13
11
|
|
|
14
12
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
@@ -29,7 +27,7 @@ var _useProvidedRefOrCreate = require("../hooks/useProvidedRefOrCreate");
|
|
|
29
27
|
|
|
30
28
|
var _useScrollFlash = _interopRequireDefault(require("../hooks/useScrollFlash"));
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _ssr = require("@react-aria/ssr");
|
|
33
31
|
|
|
34
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
33
|
|
|
@@ -39,6 +37,34 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
39
37
|
|
|
40
38
|
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); }
|
|
41
39
|
|
|
40
|
+
function scrollIntoViewingArea(child, container, margin = 8, behavior = 'smooth') {
|
|
41
|
+
const {
|
|
42
|
+
top: childTop,
|
|
43
|
+
bottom: childBottom
|
|
44
|
+
} = child.getBoundingClientRect();
|
|
45
|
+
const {
|
|
46
|
+
top: containerTop,
|
|
47
|
+
bottom: containerBottom
|
|
48
|
+
} = container.getBoundingClientRect();
|
|
49
|
+
const isChildTopAboveViewingArea = childTop < containerTop + margin;
|
|
50
|
+
const isChildBottomBelowViewingArea = childBottom > containerBottom - margin;
|
|
51
|
+
|
|
52
|
+
if (isChildTopAboveViewingArea) {
|
|
53
|
+
const scrollHeightToChildTop = childTop - containerTop + container.scrollTop;
|
|
54
|
+
container.scrollTo({
|
|
55
|
+
behavior,
|
|
56
|
+
top: scrollHeightToChildTop - margin
|
|
57
|
+
});
|
|
58
|
+
} else if (isChildBottomBelowViewingArea) {
|
|
59
|
+
const scrollHeightToChildBottom = childBottom - containerBottom + container.scrollTop;
|
|
60
|
+
container.scrollTo({
|
|
61
|
+
behavior,
|
|
62
|
+
top: scrollHeightToChildBottom + margin
|
|
63
|
+
});
|
|
64
|
+
} // either completely in view or outside viewing area on both ends, don't scroll
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
42
68
|
const StyledHeader = _styledComponents.default.div.withConfig({
|
|
43
69
|
displayName: "FilteredActionList__StyledHeader",
|
|
44
70
|
componentId: "yg3jkv-0"
|
|
@@ -86,7 +112,7 @@ function FilteredActionList({
|
|
|
86
112
|
activeDescendantRef.current = current;
|
|
87
113
|
|
|
88
114
|
if (current && scrollContainerRef.current && directlyActivated) {
|
|
89
|
-
|
|
115
|
+
scrollIntoViewingArea(current, scrollContainerRef.current);
|
|
90
116
|
}
|
|
91
117
|
}
|
|
92
118
|
}, [// List ref isn't set while loading. Need to re-bind focus zone when it changes
|
|
@@ -94,7 +120,7 @@ function FilteredActionList({
|
|
|
94
120
|
(0, _react.useEffect)(() => {
|
|
95
121
|
// if items changed, we want to instantly move active descendant into view
|
|
96
122
|
if (activeDescendantRef.current && scrollContainerRef.current) {
|
|
97
|
-
|
|
123
|
+
scrollIntoViewingArea(activeDescendantRef.current, scrollContainerRef.current, undefined, 'auto');
|
|
98
124
|
}
|
|
99
125
|
}, [items]);
|
|
100
126
|
(0, _useScrollFlash.default)(scrollContainerRef);
|
package/lib/Flash.js
CHANGED
|
@@ -18,35 +18,35 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
const variants = (0, _styledSystem.variant)({
|
|
19
19
|
variants: {
|
|
20
20
|
default: {
|
|
21
|
-
color: '
|
|
22
|
-
backgroundColor: '
|
|
23
|
-
borderColor: '
|
|
21
|
+
color: 'alert.info.text',
|
|
22
|
+
backgroundColor: 'alert.info.bg',
|
|
23
|
+
borderColor: 'alert.info.border',
|
|
24
24
|
svg: {
|
|
25
|
-
color: '
|
|
25
|
+
color: 'alert.info.icon'
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
success: {
|
|
29
|
-
color: '
|
|
30
|
-
backgroundColor: 'success.
|
|
31
|
-
borderColor: 'success.
|
|
29
|
+
color: 'alert.success.text',
|
|
30
|
+
backgroundColor: 'alert.success.bg',
|
|
31
|
+
borderColor: 'alert.success.border',
|
|
32
32
|
svg: {
|
|
33
|
-
color: 'success.
|
|
33
|
+
color: 'alert.success.icon'
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
danger: {
|
|
37
|
-
color: '
|
|
38
|
-
backgroundColor: '
|
|
39
|
-
borderColor: '
|
|
37
|
+
color: 'alert.error.text',
|
|
38
|
+
backgroundColor: 'alert.error.bg',
|
|
39
|
+
borderColor: 'alert.error.border',
|
|
40
40
|
svg: {
|
|
41
|
-
color: '
|
|
41
|
+
color: 'alert.error.icon'
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
warning: {
|
|
45
|
-
color: '
|
|
46
|
-
backgroundColor: '
|
|
47
|
-
borderColor: '
|
|
45
|
+
color: 'alert.warn.text',
|
|
46
|
+
backgroundColor: 'alert.warn.bg',
|
|
47
|
+
borderColor: 'alert.warn.border',
|
|
48
48
|
svg: {
|
|
49
|
-
color: '
|
|
49
|
+
color: 'alert.warn.icon'
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
package/lib/Label.js
CHANGED
|
@@ -52,7 +52,7 @@ const Label = _styledComponents.default.span.withConfig({
|
|
|
52
52
|
})(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";&:hover{text-decoration:none;}", " ", " ", " ", " ", ""], (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('radii.3'), sizeVariant, _constants.COMMON, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', _sx.default);
|
|
53
53
|
|
|
54
54
|
Label.defaultProps = {
|
|
55
|
-
bg: '
|
|
55
|
+
bg: 'label.primary.border',
|
|
56
56
|
variant: 'medium'
|
|
57
57
|
};
|
|
58
58
|
var _default = Label;
|
package/lib/Overlay.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ export declare type OverlayProps = {
|
|
|
40
40
|
top: number;
|
|
41
41
|
left: number;
|
|
42
42
|
portalContainerName?: string;
|
|
43
|
-
preventFocusOnOpen?: boolean;
|
|
44
43
|
} & Omit<ComponentProps<typeof StyledOverlay>, 'visibility' | keyof SystemPositionProps>;
|
|
45
44
|
/**
|
|
46
45
|
* An `Overlay` is a flexible floating surface, used to display transient content such as menus,
|
package/lib/Overlay.js
CHANGED
|
@@ -113,7 +113,6 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
113
113
|
left,
|
|
114
114
|
anchorSide,
|
|
115
115
|
portalContainerName,
|
|
116
|
-
preventFocusOnOpen,
|
|
117
116
|
...rest
|
|
118
117
|
}, forwardedRef) => {
|
|
119
118
|
const overlayRef = (0, _react.useRef)(null);
|
|
@@ -129,8 +128,7 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
129
128
|
onEscape,
|
|
130
129
|
ignoreClickRefs,
|
|
131
130
|
onClickOutside,
|
|
132
|
-
initialFocusRef
|
|
133
|
-
preventFocusOnOpen
|
|
131
|
+
initialFocusRef
|
|
134
132
|
});
|
|
135
133
|
(0, _react.useEffect)(() => {
|
|
136
134
|
var _combinedRef$current;
|
|
@@ -24,7 +24,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
24
24
|
const Page = _styledComponents.default.a.withConfig({
|
|
25
25
|
displayName: "Pagination__Page",
|
|
26
26
|
componentId: "b80nss-0"
|
|
27
|
-
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}", ";"], (0, _constants.get)('colors.fg.default'), (0, _constants.get)('space.1'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.
|
|
27
|
+
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}", ";"], (0, _constants.get)('colors.fg.default'), (0, _constants.get)('space.1'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), _constants.COMMON);
|
|
28
28
|
|
|
29
29
|
function usePaginationPages({
|
|
30
30
|
theme,
|
package/lib/ProgressBar.js
CHANGED
|
@@ -32,15 +32,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
|
32
32
|
Divider: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
|
33
33
|
Filter: React.ForwardRefExoticComponent<Pick<{
|
|
34
34
|
value?: string | undefined;
|
|
35
|
-
} & Pick<
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
[x: number]: any;
|
|
38
|
-
} & {
|
|
39
|
-
theme?: any;
|
|
40
|
-
} & {
|
|
41
|
-
as?: string | React.ComponentType<any> | undefined;
|
|
42
|
-
forwardedAs?: string | React.ComponentType<any> | undefined;
|
|
43
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
|
|
35
|
+
} & Pick<{
|
|
44
36
|
className?: string | undefined;
|
|
45
37
|
icon?: React.ComponentType<{
|
|
46
38
|
className?: string | undefined;
|
|
@@ -315,7 +307,15 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
|
315
307
|
contrast?: boolean | undefined;
|
|
316
308
|
} & {
|
|
317
309
|
theme?: any;
|
|
318
|
-
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast"
|
|
310
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast"> & Omit<Pick<{
|
|
311
|
+
[x: string]: any;
|
|
312
|
+
[x: number]: any;
|
|
313
|
+
} & {
|
|
314
|
+
theme?: any;
|
|
315
|
+
} & {
|
|
316
|
+
as?: string | React.ComponentType<any> | undefined;
|
|
317
|
+
forwardedAs?: string | React.ComponentType<any> | undefined;
|
|
318
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
|
319
319
|
Footer: import("styled-components").StyledComponent<"footer", any, SystemCommonProps & SxProp, never>;
|
|
320
320
|
Item: React.ForwardRefExoticComponent<Pick<{
|
|
321
321
|
as?: React.ElementType<any> | undefined;
|
package/lib/StateLabel.js
CHANGED
|
@@ -35,28 +35,34 @@ const colorVariants = (0, _styledSystem.variant)({
|
|
|
35
35
|
prop: 'status',
|
|
36
36
|
variants: {
|
|
37
37
|
issueClosed: {
|
|
38
|
-
backgroundColor: '
|
|
39
|
-
color: '
|
|
38
|
+
backgroundColor: 'prState.closed.bg',
|
|
39
|
+
color: 'prState.closed.text',
|
|
40
|
+
borderColor: 'prState.closed.border'
|
|
40
41
|
},
|
|
41
42
|
pullClosed: {
|
|
42
|
-
backgroundColor: '
|
|
43
|
-
color: '
|
|
43
|
+
backgroundColor: 'prState.closed.bg',
|
|
44
|
+
color: 'prState.closed.text',
|
|
45
|
+
borderColor: 'prState.closed.border'
|
|
44
46
|
},
|
|
45
47
|
pullMerged: {
|
|
46
|
-
backgroundColor: '
|
|
47
|
-
color: '
|
|
48
|
+
backgroundColor: 'prState.merged.bg',
|
|
49
|
+
color: 'prState.merged.text',
|
|
50
|
+
borderColor: 'prState.merged.border'
|
|
48
51
|
},
|
|
49
52
|
issueOpened: {
|
|
50
|
-
backgroundColor: '
|
|
51
|
-
color: '
|
|
53
|
+
backgroundColor: 'prState.open.bg',
|
|
54
|
+
color: 'prState.open.text',
|
|
55
|
+
borderColor: 'prState.open.border'
|
|
52
56
|
},
|
|
53
57
|
pullOpened: {
|
|
54
|
-
backgroundColor: '
|
|
55
|
-
color: '
|
|
58
|
+
backgroundColor: 'prState.open.bg',
|
|
59
|
+
color: 'prState.open.text',
|
|
60
|
+
borderColor: 'prState.open.border'
|
|
56
61
|
},
|
|
57
62
|
draft: {
|
|
58
|
-
backgroundColor: '
|
|
59
|
-
color: '
|
|
63
|
+
backgroundColor: 'prState.draft.bg',
|
|
64
|
+
color: 'prState.draft.text',
|
|
65
|
+
borderColor: 'prState.draft.border'
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
});
|
|
@@ -79,7 +85,7 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
|
79
85
|
const StateLabelBase = _styledComponents.default.span.withConfig({
|
|
80
86
|
displayName: "StateLabel__StateLabelBase",
|
|
81
87
|
componentId: "k4pd9e-0"
|
|
82
|
-
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";", ";", ";", ";", ";"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.canvas.default'), (0, _constants.get)('radii.3'), colorVariants, sizeVariants, _constants.COMMON, _sx.default);
|
|
88
|
+
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";border-width:1px;border-style:solid;", ";", ";", ";", ";"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.canvas.default'), (0, _constants.get)('radii.3'), colorVariants, sizeVariants, _constants.COMMON, _sx.default);
|
|
83
89
|
|
|
84
90
|
function StateLabel({
|
|
85
91
|
children,
|
package/lib/TextInput.d.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { MaxWidthProps, MinWidthProps, WidthProps } from 'styled-system';
|
|
3
|
+
import { SxProp } from './sx';
|
|
4
|
+
import { ComponentProps } from './utils/types';
|
|
5
|
+
declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
6
|
+
declare const Wrapper: import("styled-components").StyledComponent<"span", any, {
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
hasIcon?: boolean | undefined;
|
|
9
|
+
block?: boolean | undefined;
|
|
10
|
+
contrast?: boolean | undefined;
|
|
11
|
+
variant?: "large" | "small" | undefined;
|
|
12
|
+
} & WidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>> & MinWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>> & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
|
|
5
13
|
declare type NonPassthroughProps = {
|
|
6
14
|
className?: string;
|
|
7
15
|
icon?: React.ComponentType<{
|
|
8
16
|
className?: string;
|
|
9
17
|
}>;
|
|
10
|
-
} & Pick<ComponentProps<typeof
|
|
11
|
-
declare type TextInputInternalProps =
|
|
18
|
+
} & Pick<ComponentProps<typeof Wrapper>, 'block' | 'contrast' | 'disabled' | 'sx' | 'theme' | 'width' | 'maxWidth' | 'minWidth' | 'variant'>;
|
|
19
|
+
declare type TextInputInternalProps = NonPassthroughProps & Omit<React.ComponentPropsWithoutRef<typeof Input>, keyof NonPassthroughProps>;
|
|
12
20
|
declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputInternalProps, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
|
13
21
|
export declare type TextInputProps = ComponentProps<typeof TextInput>;
|
|
14
22
|
export default TextInput;
|