@activecollab/components 2.0.509 → 2.0.511
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/dist/cjs/components/CaretButton/CaretButton.js +2 -4
- package/dist/cjs/components/CaretButton/CaretButton.js.map +1 -1
- package/dist/cjs/components/CaretButton/Styles.js +7 -1
- package/dist/cjs/components/CaretButton/Styles.js.map +1 -1
- package/dist/cjs/components/CounterButton/CounterButton.js +1 -2
- package/dist/cjs/components/CounterButton/CounterButton.js.map +1 -1
- package/dist/cjs/components/EditableHours/EditableHours.js +1 -3
- package/dist/cjs/components/EditableHours/EditableHours.js.map +1 -1
- package/dist/cjs/components/Filter/Filter.js +9 -2
- package/dist/cjs/components/Filter/Filter.js.map +1 -1
- package/dist/cjs/components/Filter/Styles.js +13 -1
- package/dist/cjs/components/Filter/Styles.js.map +1 -1
- package/dist/cjs/components/FilterInput/FilterInput.js +6 -1
- package/dist/cjs/components/FilterInput/FilterInput.js.map +1 -1
- package/dist/cjs/components/FilterInput/FilterInput.styles.js +5 -2
- package/dist/cjs/components/FilterInput/FilterInput.styles.js.map +1 -1
- package/dist/cjs/components/Header/Styles.js +1 -1
- package/dist/cjs/components/Header/Styles.js.map +1 -1
- package/dist/cjs/components/Icons/collection/ArrowRestore.js +1 -0
- package/dist/cjs/components/Icons/collection/ArrowRestore.js.map +1 -1
- package/dist/cjs/components/Icons/collection/CalendarDay.js +64 -0
- package/dist/cjs/components/Icons/collection/CalendarDay.js.map +1 -0
- package/dist/cjs/components/Icons/collection/CalendarMonth.js +64 -0
- package/dist/cjs/components/Icons/collection/CalendarMonth.js.map +1 -0
- package/dist/cjs/components/Icons/collection/CalendarWeek.js +64 -0
- package/dist/cjs/components/Icons/collection/CalendarWeek.js.map +1 -0
- package/dist/cjs/components/Icons/collection/Notebook.js +1 -0
- package/dist/cjs/components/Icons/collection/Notebook.js.map +1 -1
- package/dist/cjs/components/Icons/collection/Pencil.js +1 -0
- package/dist/cjs/components/Icons/collection/Pencil.js.map +1 -1
- package/dist/cjs/components/Icons/collection/index.js +21 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/cjs/components/MultiAvatar/MultiAvatar.js +1 -3
- package/dist/cjs/components/MultiAvatar/MultiAvatar.js.map +1 -1
- package/dist/cjs/components/MultiAvatar/Styles.js +8 -3
- package/dist/cjs/components/MultiAvatar/Styles.js.map +1 -1
- package/dist/cjs/components/Steppers/DateStepper/DateStepper.js +219 -35
- package/dist/cjs/components/Steppers/DateStepper/DateStepper.js.map +1 -1
- package/dist/cjs/components/Steppers/DateStepper/Styles.js +74 -4
- package/dist/cjs/components/Steppers/DateStepper/Styles.js.map +1 -1
- package/dist/cjs/components/Stopwatch/Stopwatch.js +2 -13
- package/dist/cjs/components/Stopwatch/Stopwatch.js.map +1 -1
- package/dist/cjs/components/Wizard/Step.js +1 -2
- package/dist/cjs/components/Wizard/Step.js.map +1 -1
- package/dist/cjs/components/Wizard/Styles.js +6 -1
- package/dist/cjs/components/Wizard/Styles.js.map +1 -1
- package/dist/cjs/utils/layers.js +16 -1
- package/dist/cjs/utils/layers.js.map +1 -1
- package/dist/cjs/utils/layers.test.js +34 -0
- package/dist/cjs/utils/layers.test.js.map +1 -0
- package/dist/esm/components/CaretButton/CaretButton.d.ts.map +1 -1
- package/dist/esm/components/CaretButton/CaretButton.js +3 -5
- package/dist/esm/components/CaretButton/CaretButton.js.map +1 -1
- package/dist/esm/components/CaretButton/Styles.d.ts +3 -0
- package/dist/esm/components/CaretButton/Styles.d.ts.map +1 -1
- package/dist/esm/components/CaretButton/Styles.js +6 -0
- package/dist/esm/components/CaretButton/Styles.js.map +1 -1
- package/dist/esm/components/CounterButton/CounterButton.d.ts.map +1 -1
- package/dist/esm/components/CounterButton/CounterButton.js +1 -2
- package/dist/esm/components/CounterButton/CounterButton.js.map +1 -1
- package/dist/esm/components/EditableHours/EditableHours.js +1 -3
- package/dist/esm/components/EditableHours/EditableHours.js.map +1 -1
- package/dist/esm/components/Filter/Filter.d.ts +3 -0
- package/dist/esm/components/Filter/Filter.d.ts.map +1 -1
- package/dist/esm/components/Filter/Filter.js +10 -3
- package/dist/esm/components/Filter/Filter.js.map +1 -1
- package/dist/esm/components/Filter/Styles.d.ts +2 -0
- package/dist/esm/components/Filter/Styles.d.ts.map +1 -1
- package/dist/esm/components/Filter/Styles.js +12 -0
- package/dist/esm/components/Filter/Styles.js.map +1 -1
- package/dist/esm/components/FilterInput/FilterInput.d.ts.map +1 -1
- package/dist/esm/components/FilterInput/FilterInput.js +6 -2
- package/dist/esm/components/FilterInput/FilterInput.js.map +1 -1
- package/dist/esm/components/FilterInput/FilterInput.styles.d.ts.map +1 -1
- package/dist/esm/components/FilterInput/FilterInput.styles.js +5 -2
- package/dist/esm/components/FilterInput/FilterInput.styles.js.map +1 -1
- package/dist/esm/components/Header/Styles.js +1 -1
- package/dist/esm/components/Header/Styles.js.map +1 -1
- package/dist/esm/components/Icons/collection/ArrowRestore.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/ArrowRestore.js +1 -0
- package/dist/esm/components/Icons/collection/ArrowRestore.js.map +1 -1
- package/dist/esm/components/Icons/collection/CalendarDay.d.ts +32 -0
- package/dist/esm/components/Icons/collection/CalendarDay.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/CalendarDay.js +57 -0
- package/dist/esm/components/Icons/collection/CalendarDay.js.map +1 -0
- package/dist/esm/components/Icons/collection/CalendarMonth.d.ts +32 -0
- package/dist/esm/components/Icons/collection/CalendarMonth.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/CalendarMonth.js +57 -0
- package/dist/esm/components/Icons/collection/CalendarMonth.js.map +1 -0
- package/dist/esm/components/Icons/collection/CalendarWeek.d.ts +32 -0
- package/dist/esm/components/Icons/collection/CalendarWeek.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/CalendarWeek.js +57 -0
- package/dist/esm/components/Icons/collection/CalendarWeek.js.map +1 -0
- package/dist/esm/components/Icons/collection/Notebook.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/Notebook.js +1 -0
- package/dist/esm/components/Icons/collection/Notebook.js.map +1 -1
- package/dist/esm/components/Icons/collection/Pencil.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/Pencil.js +1 -0
- package/dist/esm/components/Icons/collection/Pencil.js.map +1 -1
- package/dist/esm/components/Icons/collection/index.d.ts +3 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +3 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/components/MultiAvatar/MultiAvatar.d.ts.map +1 -1
- package/dist/esm/components/MultiAvatar/MultiAvatar.js +2 -4
- package/dist/esm/components/MultiAvatar/MultiAvatar.js.map +1 -1
- package/dist/esm/components/MultiAvatar/Styles.d.ts +1 -0
- package/dist/esm/components/MultiAvatar/Styles.d.ts.map +1 -1
- package/dist/esm/components/MultiAvatar/Styles.js +7 -2
- package/dist/esm/components/MultiAvatar/Styles.js.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/DateStepper.d.ts +25 -2
- package/dist/esm/components/Steppers/DateStepper/DateStepper.d.ts.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/DateStepper.js +194 -31
- package/dist/esm/components/Steppers/DateStepper/DateStepper.js.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/Styles.d.ts +15 -0
- package/dist/esm/components/Steppers/DateStepper/Styles.d.ts.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/Styles.js +73 -3
- package/dist/esm/components/Steppers/DateStepper/Styles.js.map +1 -1
- package/dist/esm/components/Stopwatch/Stopwatch.d.ts.map +1 -1
- package/dist/esm/components/Stopwatch/Stopwatch.js +2 -12
- package/dist/esm/components/Stopwatch/Stopwatch.js.map +1 -1
- package/dist/esm/components/Wizard/Step.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Step.js +2 -3
- package/dist/esm/components/Wizard/Step.js.map +1 -1
- package/dist/esm/components/Wizard/Styles.d.ts +3 -0
- package/dist/esm/components/Wizard/Styles.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Styles.js +5 -0
- package/dist/esm/components/Wizard/Styles.js.map +1 -1
- package/dist/esm/utils/layers.d.ts +7 -0
- package/dist/esm/utils/layers.d.ts.map +1 -1
- package/dist/esm/utils/layers.js +13 -0
- package/dist/esm/utils/layers.js.map +1 -1
- package/dist/esm/utils/layers.test.d.ts +2 -0
- package/dist/esm/utils/layers.test.d.ts.map +1 -0
- package/dist/esm/utils/layers.test.js +32 -0
- package/dist/esm/utils/layers.test.js.map +1 -0
- package/dist/index.js +727 -262
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledSpan = exports.StyledMenu = exports.StyledDiv = exports.StyledControl = exports.StyledButtonGroup = exports.StyledButton = void 0;
|
|
6
|
+
exports.StyledStepValue = exports.StyledStepOptionIcon = exports.StyledSpan = exports.StyledPillLabel = exports.StyledPillDivider = exports.StyledPillButton = exports.StyledPillBadge = exports.StyledPillArrow = exports.StyledPill = exports.StyledMenu = exports.StyledDiv = exports.StyledDateValue = exports.StyledControl = exports.StyledButtonGroup = exports.StyledButton = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _BoxSizingStyle = require("../../BoxSizingStyle");
|
|
9
9
|
var _ButtonGroup = require("../../ButtonGroup");
|
|
@@ -45,7 +45,7 @@ var StyledMenu = exports.StyledMenu = (0, _styledComponents.default)(_Menu.Menu)
|
|
|
45
45
|
var StyledButtonGroup = exports.StyledButtonGroup = (0, _styledComponents.default)(_ButtonGroup.ButtonGroup).withConfig({
|
|
46
46
|
displayName: "Styles__StyledButtonGroup",
|
|
47
47
|
componentId: "sc-1v8h7mt-2"
|
|
48
|
-
})(["", " ", " button:hover{position:relative;z-index:1;}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle);
|
|
48
|
+
})(["", " ", " button:hover{position:relative;z-index:1;}> button:first-child + div{margin-left:-1px;}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle);
|
|
49
49
|
var StyledSpan = exports.StyledSpan = _styledComponents.default.span.withConfig({
|
|
50
50
|
displayName: "Styles__StyledSpan",
|
|
51
51
|
componentId: "sc-1v8h7mt-3"
|
|
@@ -82,7 +82,7 @@ var StyledDiv = exports.StyledDiv = _styledComponents.default.div.withConfig({
|
|
|
82
82
|
"WebkitFontSmoothing": "antialiased",
|
|
83
83
|
"MozOsxFontSmoothing": "grayscale"
|
|
84
84
|
}, function (props) {
|
|
85
|
-
return props.$mode !== "flat" && (0, _styledComponents.css)(["border:1px solid var(--color-theme-
|
|
85
|
+
return props.$mode !== "flat" && (0, _styledComponents.css)(["border:1px solid var(--color-theme-600);"]);
|
|
86
86
|
}, function (props) {
|
|
87
87
|
return !props.$alwaysShowDate && (0, _styledComponents.css)(["@media (max-width:768px){display:none;}"]);
|
|
88
88
|
}, function (props) {
|
|
@@ -93,7 +93,77 @@ var StyledDiv = exports.StyledDiv = _styledComponents.default.div.withConfig({
|
|
|
93
93
|
var StyledControl = exports.StyledControl = (0, _styledComponents.default)(_IconButton.IconButton).withConfig({
|
|
94
94
|
displayName: "Styles__StyledControl",
|
|
95
95
|
componentId: "sc-1v8h7mt-5"
|
|
96
|
-
})(["border-radius:var(--ac-br-8);"]);
|
|
96
|
+
})(["border-radius:var(--ac-br-8);&&:not(:hover):not(:active){border-color:var(--color-theme-600);}&&:disabled{opacity:1;svg{opacity:0.5;}}"]);
|
|
97
|
+
var StyledStepValue = exports.StyledStepValue = _styledComponents.default.span.withConfig({
|
|
98
|
+
displayName: "Styles__StyledStepValue",
|
|
99
|
+
componentId: "sc-1v8h7mt-6"
|
|
100
|
+
})(["display:inline-flex;align-items:center;justify-content:center;gap:2px;margin-right:-4px;white-space:nowrap;&& svg{width:16px;height:16px;flex-shrink:0;color:inherit;fill:currentColor;}"]);
|
|
101
|
+
|
|
102
|
+
/* the label keeps the middle of the button and the caret stands at its right edge */
|
|
103
|
+
var StyledDateValue = exports.StyledDateValue = (0, _styledComponents.default)(StyledStepValue).withConfig({
|
|
104
|
+
displayName: "Styles__StyledDateValue",
|
|
105
|
+
componentId: "sc-1v8h7mt-7"
|
|
106
|
+
})(["display:flex;width:calc(100% + 6px);margin-right:-6px;gap:4px;> span{flex:1 1 0;min-width:0;text-align:center;}"]);
|
|
107
|
+
StyledDateValue.displayName = "StyledDateValue";
|
|
108
|
+
/* an icon in the list of steps keeps the default icon color, as in every other menu */
|
|
109
|
+
var StyledStepOptionIcon = exports.StyledStepOptionIcon = _styledComponents.default.span.withConfig({
|
|
110
|
+
displayName: "Styles__StyledStepOptionIcon",
|
|
111
|
+
componentId: "sc-1v8h7mt-8"
|
|
112
|
+
})(["display:inline-flex;margin-right:8px;vertical-align:middle;&& svg{width:20px;height:20px;}"]);
|
|
113
|
+
StyledStepOptionIcon.displayName = "StyledStepOptionIcon";
|
|
114
|
+
StyledStepValue.displayName = "StyledStepValue";
|
|
115
|
+
/* The pill appearance: one soft filled pill, with no borders. The paper shows as the line before the step picker. */
|
|
116
|
+
var StyledPill = exports.StyledPill = _styledComponents.default.div.withConfig({
|
|
117
|
+
displayName: "Styles__StyledPill",
|
|
118
|
+
componentId: "sc-1v8h7mt-9"
|
|
119
|
+
})(["", " ", " --c-date-stepper-height:32px;--c-date-stepper-arrow:24px;display:inline-flex;align-items:stretch;height:var(--c-date-stepper-height);border-radius:16px;background-color:color-mix(in srgb,var(--color-theme-900) 8%,transparent);&.c-date-stepper--small{--c-date-stepper-height:30px;--c-date-stepper-arrow:20px;}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle);
|
|
120
|
+
var pillPart = (0, _styledComponents.css)(["display:inline-flex;align-items:center;justify-content:center;height:var(--c-date-stepper-height);margin:0;border:0;background:none;color:var(--color-theme-800);font:inherit;cursor:pointer;svg{flex-shrink:0;color:inherit;fill:currentColor;}&:focus{outline:none;}&:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px;}"]);
|
|
121
|
+
var StyledPillArrow = exports.StyledPillArrow = _styledComponents.default.button.withConfig({
|
|
122
|
+
displayName: "Styles__StyledPillArrow",
|
|
123
|
+
componentId: "sc-1v8h7mt-10"
|
|
124
|
+
})(["", " padding:", ";border-radius:", ";color:var(--color-theme-900);svg{width:var(--c-date-stepper-arrow);height:var(--c-date-stepper-arrow);}&:hover:not(:disabled){color:var(--color-primary);}&:disabled{cursor:default;color:var(--color-theme-500);}"], pillPart, function (_ref) {
|
|
125
|
+
var $side = _ref.$side;
|
|
126
|
+
return $side === "start" ? "0 4px 0 6px" : "0 6px 0 4px";
|
|
127
|
+
}, function (_ref2) {
|
|
128
|
+
var $side = _ref2.$side;
|
|
129
|
+
return $side === "start" ? "16px 0 0 16px" : "0 16px 16px 0";
|
|
130
|
+
});
|
|
131
|
+
var StyledPillButton = exports.StyledPillButton = _styledComponents.default.button.withConfig({
|
|
132
|
+
displayName: "Styles__StyledPillButton",
|
|
133
|
+
componentId: "sc-1v8h7mt-11"
|
|
134
|
+
})(["", " gap:", "px;padding:", ";font-size:14px;font-weight:500;line-height:1;white-space:nowrap;svg{width:16px;height:16px;color:var(--color-theme-700);}&:hover,&[aria-expanded=\"true\"]{color:var(--color-primary);svg{color:var(--color-primary);}}"], pillPart, function (_ref3) {
|
|
135
|
+
var $compact = _ref3.$compact;
|
|
136
|
+
return $compact ? 0 : 6;
|
|
137
|
+
}, function (_ref4) {
|
|
138
|
+
var $compact = _ref4.$compact;
|
|
139
|
+
return $compact ? "0 6px" : "0 4px 0 6px";
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
/* next to a badge the text ends at the badge, so the distance between the two never changes */
|
|
143
|
+
var StyledPillLabel = exports.StyledPillLabel = _styledComponents.default.span.withConfig({
|
|
144
|
+
displayName: "Styles__StyledPillLabel",
|
|
145
|
+
componentId: "sc-1v8h7mt-12"
|
|
146
|
+
})(["display:inline-block;text-align:", ";margin-right:", "px;"], function (_ref5) {
|
|
147
|
+
var $withBadge = _ref5.$withBadge;
|
|
148
|
+
return $withBadge ? "right" : "center";
|
|
149
|
+
}, function (_ref6) {
|
|
150
|
+
var $withBadge = _ref6.$withBadge;
|
|
151
|
+
return $withBadge ? -2 : 0;
|
|
152
|
+
});
|
|
153
|
+
var StyledPillBadge = exports.StyledPillBadge = _styledComponents.default.span.withConfig({
|
|
154
|
+
displayName: "Styles__StyledPillBadge",
|
|
155
|
+
componentId: "sc-1v8h7mt-13"
|
|
156
|
+
})(["display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:18px;padding:0 6px;border-radius:9px;border:1px solid color-mix(in srgb,var(--page-paper-main) 50%,transparent);background-color:transparent;color:var(--color-theme-700);font-size:11px;font-variant-numeric:tabular-nums;box-sizing:border-box;"]);
|
|
157
|
+
var StyledPillDivider = exports.StyledPillDivider = _styledComponents.default.span.withConfig({
|
|
158
|
+
displayName: "Styles__StyledPillDivider",
|
|
159
|
+
componentId: "sc-1v8h7mt-14"
|
|
160
|
+
})(["flex:0 0 1px;background-color:var(--page-paper-main);"]);
|
|
161
|
+
StyledPill.displayName = "StyledPill";
|
|
162
|
+
StyledPillArrow.displayName = "StyledPillArrow";
|
|
163
|
+
StyledPillButton.displayName = "StyledPillButton";
|
|
164
|
+
StyledPillLabel.displayName = "StyledPillLabel";
|
|
165
|
+
StyledPillBadge.displayName = "StyledPillBadge";
|
|
166
|
+
StyledPillDivider.displayName = "StyledPillDivider";
|
|
97
167
|
StyledButtonGroup.displayName = "StyledButtonGroup";
|
|
98
168
|
StyledSpan.displayName = "StyledSpan";
|
|
99
169
|
StyledDiv.displayName = "StyledDiv";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_ButtonGroup","_FontStyle","_IconButton","_Menu","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledButton","exports","styled","button","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","props","$step","css","StyledMenu","Menu","StyledButtonGroup","ButtonGroup","StyledSpan","span","StyledDiv","div","$isTargetable","$isRounded","$mode","$alwaysShowDate","StyledControl","IconButton"],"sources":["../../../../../src/components/Steppers/DateStepper/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../../BoxSizingStyle\";\nimport { ButtonGroup } from \"../../ButtonGroup\";\nimport { FontStyle } from \"../../FontStyle\";\nimport { IconButton } from \"../../IconButton\";\nimport { Menu } from \"../../Menu\";\n\nexport const StyledButton = styled.button<{ $step: string }>`\n ${FontStyle}\n ${BoxSizingStyle}\n ${(props) =>\n props.$step === \"range\" &&\n css`\n padding: 0 12px !important;\n `}\n\n ${tw`\n tw-relative\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n tw-text-center\n `}\n\n color: var(--color-theme-700);\n margin: 0;\n padding: 0;\n background: none;\n width: 100%;\n height: auto;\n border: none;\n height: 30px;\n line-height: 1;\n transition: all 0.3s ease;\n\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n`;\n\nexport const StyledMenu = styled(Menu)`\n ${tw`\n tw-w-auto\n tw-h-auto\n tw-py-4\n tw-px-2\n `}\n`;\n\nexport const StyledButtonGroup = styled(ButtonGroup)`\n ${FontStyle}\n ${BoxSizingStyle}\n\n button:hover {\n position: relative;\n z-index: 1;\n }\n`;\n\nexport const StyledSpan = styled.span`\n line-height: 30px;\n color: var(--color-theme-700);\n`;\n\ninterface StyledDiv {\n $isTargetable: boolean;\n $isRounded: boolean;\n $mode: string;\n $alwaysShowDate: boolean;\n}\n\nexport const StyledDiv = styled.div<StyledDiv>`\n ${(props) =>\n props.$isTargetable &&\n css`\n ${tw`tw-pointer-events-none`}\n `}\n\n ${(props) =>\n props.$isRounded &&\n css`\n border-radius: var(--ac-br-8);\n padding: 0 12px !important;\n `}\n\n ${(props) =>\n props.$mode !== \"flat\"\n ? tw`\n tw-border\n tw-border-solid\n `\n : tw`tw-border-0`}\n\n ${tw`\n tw-relative\n tw-text-center\n tw-p-0\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n `}\n\n height: 32px;\n transition: all 0.3s ease;\n background-color: transparent;\n ${(props) =>\n props.$mode !== \"flat\" &&\n css`\n border: 1px solid var(--color-theme-700);\n `}\n\n color: var(--color-theme-700);\n margin-right: -1px;\n display: block;\n\n ${(props) =>\n !props.$alwaysShowDate &&\n css`\n @media (max-width: 768px) {\n display: none;\n }\n `}\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n\n &:hover {\n ${(props) =>\n props.$mode !== \"flat\" &&\n css`\n border-color: var(--color-primary);\n `}\n color: var(--color-primary);\n text-decoration: none;\n }\n\n &:active {\n ${(props) =>\n props.$mode !== \"flat\" &&\n css`\n border-color: var(--color-primary);\n background-color: var(--color-primary-200);\n `}\n color: var(--color-primary);\n }\n`;\n\nexport const StyledControl = styled(IconButton)`\n border-radius: var(--ac-br-8);\n`;\n\nStyledButtonGroup.displayName = \"StyledButtonGroup\";\nStyledSpan.displayName = \"StyledSpan\";\nStyledDiv.displayName = \"StyledDiv\";\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GA,CAAC,GACD;IAAA;EAAY,CAAC;AAAA,GAEjB;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAcJ,CAAC,EAKC,UAACb,KAAK;EAAA,OACNA,KAAK,CAACa,KAAK,KAAK,MAAM,QACtBX,qBAAG,+CAEF;AAAA,GAMD,UAACF,KAAK;EAAA,OACN,CAACA,KAAK,CAACc,eAAe,QACtBZ,qBAAG,8CAIF;AAAA,GAoBC,UAACF,KAAK;EAAA,OACNA,KAAK,CAACa,KAAK,KAAK,MAAM,QACtBX,qBAAG,yCAEF;AAAA,GAMD,UAACF,KAAK;EAAA,OACNA,KAAK,CAACa,KAAK,KAAK,MAAM,QACtBX,qBAAG,mFAGF;AAAA,EAGN;AAEM,IAAMa,aAAa,GAAAvB,OAAA,CAAAuB,aAAA,GAAG,IAAAtB,yBAAM,EAACuB,sBAAU,CAAC,CAAArB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qCAE9C;AAEDQ,iBAAiB,CAACT,WAAW,GAAG,mBAAmB;AACnDW,UAAU,CAACX,WAAW,GAAG,YAAY;AACrCa,SAAS,CAACb,WAAW,GAAG,WAAW;AACnCO,UAAU,CAACP,WAAW,GAAG,YAAY;AACrCL,YAAY,CAACK,WAAW,GAAG,cAAc;AACzCmB,aAAa,CAACnB,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_ButtonGroup","_FontStyle","_IconButton","_Menu","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledButton","exports","styled","button","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","props","$step","css","StyledMenu","Menu","StyledButtonGroup","ButtonGroup","StyledSpan","span","StyledDiv","div","$isTargetable","$isRounded","$mode","$alwaysShowDate","StyledControl","IconButton","StyledStepValue","StyledDateValue","StyledStepOptionIcon","StyledPill","pillPart","StyledPillArrow","_ref","$side","_ref2","StyledPillButton","_ref3","$compact","_ref4","StyledPillLabel","_ref5","$withBadge","_ref6","StyledPillBadge","StyledPillDivider"],"sources":["../../../../../src/components/Steppers/DateStepper/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../../BoxSizingStyle\";\nimport { ButtonGroup } from \"../../ButtonGroup\";\nimport { FontStyle } from \"../../FontStyle\";\nimport { IconButton } from \"../../IconButton\";\nimport { Menu } from \"../../Menu\";\n\nexport const StyledButton = styled.button<{ $step: string }>`\n ${FontStyle}\n ${BoxSizingStyle}\n ${(props) =>\n props.$step === \"range\" &&\n css`\n padding: 0 12px !important;\n `}\n\n ${tw`\n tw-relative\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n tw-text-center\n `}\n\n color: var(--color-theme-700);\n margin: 0;\n padding: 0;\n background: none;\n width: 100%;\n height: auto;\n border: none;\n height: 30px;\n line-height: 1;\n transition: all 0.3s ease;\n\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n`;\n\nexport const StyledMenu = styled(Menu)`\n ${tw`\n tw-w-auto\n tw-h-auto\n tw-py-4\n tw-px-2\n `}\n`;\n\nexport const StyledButtonGroup = styled(ButtonGroup)`\n ${FontStyle}\n ${BoxSizingStyle}\n\n button:hover {\n position: relative;\n z-index: 1;\n }\n\n /* the segment after the back arrow shares its left border with the arrow */\n > button:first-child + div {\n margin-left: -1px;\n }\n`;\n\nexport const StyledSpan = styled.span`\n line-height: 30px;\n color: var(--color-theme-700);\n`;\n\ninterface StyledDiv {\n $isTargetable: boolean;\n $isRounded: boolean;\n $mode: string;\n $alwaysShowDate: boolean;\n}\n\nexport const StyledDiv = styled.div<StyledDiv>`\n ${(props) =>\n props.$isTargetable &&\n css`\n ${tw`tw-pointer-events-none`}\n `}\n\n ${(props) =>\n props.$isRounded &&\n css`\n border-radius: var(--ac-br-8);\n padding: 0 12px !important;\n `}\n\n ${(props) =>\n props.$mode !== \"flat\"\n ? tw`\n tw-border\n tw-border-solid\n `\n : tw`tw-border-0`}\n\n ${tw`\n tw-relative\n tw-text-center\n tw-p-0\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n `}\n\n height: 32px;\n transition: all 0.3s ease;\n background-color: transparent;\n ${(props) =>\n props.$mode !== \"flat\" &&\n css`\n border: 1px solid var(--color-theme-600);\n `}\n\n color: var(--color-theme-700);\n margin-right: -1px;\n display: block;\n\n ${(props) =>\n !props.$alwaysShowDate &&\n css`\n @media (max-width: 768px) {\n display: none;\n }\n `}\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n\n &:hover {\n ${(props) =>\n props.$mode !== \"flat\" &&\n css`\n border-color: var(--color-primary);\n `}\n color: var(--color-primary);\n text-decoration: none;\n }\n\n &:active {\n ${(props) =>\n props.$mode !== \"flat\" &&\n css`\n border-color: var(--color-primary);\n background-color: var(--color-primary-200);\n `}\n color: var(--color-primary);\n }\n`;\n\nexport const StyledControl = styled(IconButton)`\n border-radius: var(--ac-br-8);\n\n /* one step closer to the paper than the text, in every theme */\n &&:not(:hover):not(:active) {\n border-color: var(--color-theme-600);\n }\n\n /* a disabled arrow dims, its border stays whole so the stepper keeps one outline */\n &&:disabled {\n opacity: 1;\n\n svg {\n opacity: 0.5;\n }\n }\n`;\n\nexport const StyledStepValue = styled.span`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 2px;\n margin-right: -4px;\n white-space: nowrap;\n\n /* the icon takes the color of the date text beside it, also on hover */\n && svg {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n color: inherit;\n fill: currentColor;\n }\n`;\n\n/* the label keeps the middle of the button and the caret stands at its right edge */\nexport const StyledDateValue = styled(StyledStepValue)`\n display: flex;\n width: calc(100% + 6px);\n margin-right: -6px;\n gap: 4px;\n\n > span {\n flex: 1 1 0;\n min-width: 0;\n text-align: center;\n }\n`;\n\nStyledDateValue.displayName = \"StyledDateValue\";\n/* an icon in the list of steps keeps the default icon color, as in every other menu */\nexport const StyledStepOptionIcon = styled.span`\n display: inline-flex;\n margin-right: 8px;\n vertical-align: middle;\n\n && svg {\n width: 20px;\n height: 20px;\n }\n`;\n\nStyledStepOptionIcon.displayName = \"StyledStepOptionIcon\";\nStyledStepValue.displayName = \"StyledStepValue\";\n/* The pill appearance: one soft filled pill, with no borders. The paper shows as the line before the step picker. */\nexport const StyledPill = styled.div`\n ${FontStyle}\n ${BoxSizingStyle}\n --c-date-stepper-height: 32px;\n --c-date-stepper-arrow: 24px;\n display: inline-flex;\n align-items: stretch;\n height: var(--c-date-stepper-height);\n border-radius: 16px;\n background-color: color-mix(in srgb, var(--color-theme-900) 8%, transparent);\n\n /* the height of a search field */\n &.c-date-stepper--small {\n --c-date-stepper-height: 30px;\n --c-date-stepper-arrow: 20px;\n }\n`;\n\nconst pillPart = css`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: var(--c-date-stepper-height);\n margin: 0;\n border: 0;\n background: none;\n color: var(--color-theme-800);\n font: inherit;\n cursor: pointer;\n\n svg {\n flex-shrink: 0;\n color: inherit;\n fill: currentColor;\n }\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: -2px;\n }\n`;\n\nexport const StyledPillArrow = styled.button<{ $side: \"start\" | \"end\" }>`\n ${pillPart}\n padding: ${({ $side }) =>\n $side === \"start\" ? \"0 4px 0 6px\" : \"0 6px 0 4px\"};\n border-radius: ${({ $side }) =>\n $side === \"start\" ? \"16px 0 0 16px\" : \"0 16px 16px 0\"};\n color: var(--color-theme-900);\n\n svg {\n width: var(--c-date-stepper-arrow);\n height: var(--c-date-stepper-arrow);\n }\n\n &:hover:not(:disabled) {\n color: var(--color-primary);\n }\n\n &:disabled {\n cursor: default;\n color: var(--color-theme-500);\n }\n`;\n\nexport const StyledPillButton = styled.button<{ $compact?: boolean }>`\n ${pillPart}\n gap: ${({ $compact }) => ($compact ? 0 : 6)}px;\n padding: ${({ $compact }) => ($compact ? \"0 6px\" : \"0 4px 0 6px\")};\n font-size: 14px;\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n\n svg {\n width: 16px;\n height: 16px;\n color: var(--color-theme-700);\n }\n\n &:hover,\n &[aria-expanded=\"true\"] {\n color: var(--color-primary);\n\n svg {\n color: var(--color-primary);\n }\n }\n`;\n\n/* next to a badge the text ends at the badge, so the distance between the two never changes */\nexport const StyledPillLabel = styled.span<{ $withBadge?: boolean }>`\n display: inline-block;\n text-align: ${({ $withBadge }) => ($withBadge ? \"right\" : \"center\")};\n margin-right: ${({ $withBadge }) => ($withBadge ? -2 : 0)}px;\n`;\n\nexport const StyledPillBadge = styled.span`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 34px;\n height: 18px;\n padding: 0 6px;\n border-radius: 9px;\n border: 1px solid color-mix(in srgb, var(--page-paper-main) 50%, transparent);\n background-color: transparent;\n color: var(--color-theme-700);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n box-sizing: border-box;\n`;\n\nexport const StyledPillDivider = styled.span`\n flex: 0 0 1px;\n background-color: var(--page-paper-main);\n`;\n\nStyledPill.displayName = \"StyledPill\";\nStyledPillArrow.displayName = \"StyledPillArrow\";\nStyledPillButton.displayName = \"StyledPillButton\";\nStyledPillLabel.displayName = \"StyledPillLabel\";\nStyledPillBadge.displayName = \"StyledPillBadge\";\nStyledPillDivider.displayName = \"StyledPillDivider\";\nStyledButtonGroup.displayName = \"StyledButtonGroup\";\nStyledSpan.displayName = \"StyledSpan\";\nStyledDiv.displayName = \"StyledDiv\";\nStyledMenu.displayName = \"StyledMenu\";\nStyledButton.displayName = \"StyledButton\";\nStyledControl.displayName = \"StyledControl\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAkC,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,wBAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,G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WAAA;AAAA,kEAE1B,UAAAkC,KAAA;EAAA,IAAGC,UAAU,GAAAD,KAAA,CAAVC,UAAU;EAAA,OAAQA,UAAU,GAAG,OAAO,GAAG,QAAQ;AAAA,CAAC,EACnD,UAAAC,KAAA;EAAA,IAAGD,UAAU,GAAAC,KAAA,CAAVD,UAAU;EAAA,OAAQA,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC;AAAA,CAAC,CAC1D;AAEM,IAAME,eAAe,GAAA1C,OAAA,CAAA0C,eAAA,GAAGzC,yBAAM,CAACe,IAAI,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6UAczC;AAEM,IAAMsC,iBAAiB,GAAA3C,OAAA,CAAA2C,iBAAA,GAAG1C,yBAAM,CAACe,IAAI,CAAAb,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6DAG3C;AAEDuB,UAAU,CAACxB,WAAW,GAAG,YAAY;AACrC0B,eAAe,CAAC1B,WAAW,GAAG,iBAAiB;AAC/C8B,gBAAgB,CAAC9B,WAAW,GAAG,kBAAkB;AACjDkC,eAAe,CAAClC,WAAW,GAAG,iBAAiB;AAC/CsC,eAAe,CAACtC,WAAW,GAAG,iBAAiB;AAC/CuC,iBAAiB,CAACvC,WAAW,GAAG,mBAAmB;AACnDS,iBAAiB,CAACT,WAAW,GAAG,mBAAmB;AACnDW,UAAU,CAACX,WAAW,GAAG,YAAY;AACrCa,SAAS,CAACb,WAAW,GAAG,WAAW;AACnCO,UAAU,CAACP,WAAW,GAAG,YAAY;AACrCL,YAAY,CAACK,WAAW,GAAG,cAAc;AACzCmB,aAAa,CAACnB,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Stopwatch = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
8
|
var _Stopwatch = require("./Stopwatch.style");
|
|
10
9
|
var _EditableHours = require("../EditableHours");
|
|
11
10
|
var _IconButton = require("../IconButton");
|
|
12
11
|
var _Icons = require("../Icons");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
13
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -23,19 +21,10 @@ var Stopwatch = exports.Stopwatch = function Stopwatch() {
|
|
|
23
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
22
|
isActive = _useState2[0],
|
|
25
23
|
setIsActive = _useState2[1];
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_Stopwatch.StyledStopwatch, {
|
|
27
|
-
className: (0, _classnames.default)("", {
|
|
28
|
-
"tw-bg-red-100": isActive,
|
|
29
|
-
"tw-bg-gray-100": !isActive
|
|
30
|
-
})
|
|
31
|
-
}, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_Stopwatch.StyledStopwatch, null, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
32
25
|
onClick: function onClick() {
|
|
33
26
|
return setIsActive(!isActive);
|
|
34
|
-
}
|
|
35
|
-
className: (0, _classnames.default)("tw-shadow-none hover:tw-shadow-none", {
|
|
36
|
-
"tw-bg-red-400 hover:bg-red-500": isActive,
|
|
37
|
-
"tw-bg-indigo-400 hover:bg-indigo-400": !isActive
|
|
38
|
-
})
|
|
27
|
+
}
|
|
39
28
|
}, !isActive ? /*#__PURE__*/_react.default.createElement(_Icons.PlaySmallIcon, null) : /*#__PURE__*/_react.default.createElement(_Icons.PauseSmallIcon, null)), /*#__PURE__*/_react.default.createElement(_Stopwatch.StyledStopwatchCenterWrapper, null, /*#__PURE__*/_react.default.createElement(_EditableHours.EditableHours, {
|
|
40
29
|
value: "00:00"
|
|
41
30
|
}), /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stopwatch.js","names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"file":"Stopwatch.js","names":["_react","_interopRequireWildcard","require","_Stopwatch","_EditableHours","_IconButton","_Icons","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","return","isArray","Stopwatch","exports","_useState","useState","_useState2","isActive","setIsActive","createElement","StyledStopwatch","IconButton","onClick","PlaySmallIcon","PauseSmallIcon","StyledStopwatchCenterWrapper","EditableHours","size","variant","NoteIcon","width","CloseIcon","StyledTrigger","UploadIcon","displayName"],"sources":["../../../../src/components/Stopwatch/Stopwatch.tsx"],"sourcesContent":["import React, { useState } from \"react\";\n\nimport {\n StyledStopwatch,\n StyledStopwatchCenterWrapper,\n StyledTrigger,\n} from \"./Stopwatch.style\";\nimport { EditableHours } from \"../EditableHours\";\nimport { IconButton } from \"../IconButton\";\nimport {\n CloseIcon,\n NoteIcon,\n PauseSmallIcon,\n PlaySmallIcon,\n UploadIcon,\n} from \"../Icons\";\n\nexport const Stopwatch = () => {\n const [isActive, setIsActive] = useState<boolean>(false);\n\n return (\n <StyledStopwatch>\n <IconButton onClick={() => setIsActive(!isActive)}>\n {!isActive ? <PlaySmallIcon /> : <PauseSmallIcon />}\n </IconButton>\n <StyledStopwatchCenterWrapper>\n <EditableHours value=\"00:00\" />\n <IconButton size=\"small\" variant=\"tertiary\">\n <NoteIcon width={20} />\n </IconButton>\n {true && (\n <IconButton size=\"small\" variant=\"tertiary\">\n <CloseIcon width={20} />\n </IconButton>\n )}\n </StyledStopwatchCenterWrapper>\n <StyledTrigger onClick={() => setIsActive(!isActive)}>\n <UploadIcon />\n </StyledTrigger>\n </StyledStopwatch>\n );\n};\n\nStopwatch.displayName = \"Stopwatch\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAMkB,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,wBAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CA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AC/BvE,MAAA,CAAAiB,OAAA,CAAA2C,aAAA,CAACzD,UAAA,CAAAsE,aAAa;IAACV,OAAO,EAAE,SAATA,OAAOA,CAAA;MAAA,OAAQJ,WAAW,CAAC,CAACD,QAAQ,CAAC;IAAA;EAAC,gBACnD1D,MAAA,CAAAiB,OAAA,CAAA2C,aAAA,CAACtD,MAAA,CAAAoE,UAAU,MAAE,CACA,CACA,CAAC;AAEtB,CAAC;AAEDrB,SAAS,CAACsB,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -41,10 +41,9 @@ var Step = exports.Step = function Step(_ref) {
|
|
|
41
41
|
}
|
|
42
42
|
return onNextButtonClick && onNextButtonClick();
|
|
43
43
|
}, [isLast, onClose, onNextButtonClick]);
|
|
44
|
-
return !skip ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Styles.StyledStepHeader, null, /*#__PURE__*/_react.default.createElement(_Styles.StyledStepHeaderLeft, null, !disableBackButton && index && index > 0 ? /*#__PURE__*/_react.default.createElement(
|
|
44
|
+
return !skip ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Styles.StyledStepHeader, null, /*#__PURE__*/_react.default.createElement(_Styles.StyledStepHeaderLeft, null, !disableBackButton && index && index > 0 ? /*#__PURE__*/_react.default.createElement(_Styles.StyledStepBackButton, {
|
|
45
45
|
onClick: onPreviousButtonClick,
|
|
46
46
|
variant: "text gray",
|
|
47
|
-
className: "tw--ml-3 tw-mr-2",
|
|
48
47
|
disabled: changingStepInProgress
|
|
49
48
|
}, /*#__PURE__*/_react.default.createElement(_Icons.ArrowBackMobileIcon, null)) : null, /*#__PURE__*/_react.default.createElement(_Styles.StyledStepTitle, null, /*#__PURE__*/_react.default.createElement(_Typography.Caption2, null, title), /*#__PURE__*/_react.default.createElement(_Typography.Header3, null, subtitle))), customRightHeader ? customRightHeader : /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
50
49
|
onClick: closeDialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.js","names":["_react","_interopRequireWildcard","require","_StepActionButton","_Styles","_Dialog","_DialogContext","_IconButton","_Icons","_Typography","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Step","exports","_ref","index","isLast","subtitle","title","onNextButtonClick","onPreviousButtonClick","onClose","children","_ref$actionLabel","actionLabel","_ref$shouldRenderNext","shouldRenderNextButton","_ref$changingStepInPr","changingStepInProgress","_ref$disableBackButto","disableBackButton","customRightHeader","_ref$skip","skip","closeDialog","useDialogClose","onActionButtonClick","useCallback","createElement","Fragment","StyledStepHeader","StyledStepHeaderLeft","
|
|
1
|
+
{"version":3,"file":"Step.js","names":["_react","_interopRequireWildcard","require","_StepActionButton","_Styles","_Dialog","_DialogContext","_IconButton","_Icons","_Typography","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Step","exports","_ref","index","isLast","subtitle","title","onNextButtonClick","onPreviousButtonClick","onClose","children","_ref$actionLabel","actionLabel","_ref$shouldRenderNext","shouldRenderNextButton","_ref$changingStepInPr","changingStepInProgress","_ref$disableBackButto","disableBackButton","customRightHeader","_ref$skip","skip","closeDialog","useDialogClose","onActionButtonClick","useCallback","createElement","Fragment","StyledStepHeader","StyledStepHeaderLeft","StyledStepBackButton","onClick","variant","disabled","ArrowBackMobileIcon","StyledStepTitle","Caption2","Header3","IconButton","CancelCrossIcon","Dialog","ContentDivider","Content","Actions","StepActionButton","StyledCustomStep","displayName"],"sources":["../../../../src/components/Wizard/Step.tsx"],"sourcesContent":["import React, { FC, ReactNode, useCallback } from \"react\";\n\nimport { StepActionButton } from \"./StepActionButton\";\nimport {\n StyledStepTitle,\n StyledStepHeaderLeft,\n StyledStepHeader,\n StyledCustomStep,\n StyledStepBackButton,\n} from \"./Styles\";\nimport { Dialog } from \"../Dialog\";\nimport { useDialogClose } from \"../Dialog/DialogContext\";\nimport { DialogSize } from \"../Dialog/Styles\";\nimport { IconButton } from \"../IconButton\";\nimport { ArrowBackMobileIcon, CancelCrossIcon } from \"../Icons\";\nimport { Caption2, Header3 } from \"../Typography\";\n\nexport interface IStep {\n index?: number;\n isLast?: boolean;\n subtitle: string;\n title?: string;\n onNextButtonClick?: () => void;\n onPreviousButtonClick?: () => void;\n onClose?: () => void;\n children: ReactNode;\n actionLabel?: string;\n shouldRenderNextButton?: boolean;\n changingStepInProgress?: boolean;\n disableBackButton?: boolean;\n customRightHeader?: ReactNode;\n skip?: boolean;\n /** Read by Wizard off the active step and passed to the dialog. */\n size?: DialogSize;\n height?: string;\n}\n\nexport const Step: FC<IStep> = ({\n index,\n isLast,\n subtitle,\n title,\n onNextButtonClick,\n onPreviousButtonClick,\n onClose,\n children,\n actionLabel = \"Proceed\",\n shouldRenderNextButton = true,\n changingStepInProgress = false,\n disableBackButton = false,\n customRightHeader,\n skip = false,\n}) => {\n // The close button goes through the dialog so the exit transition runs before the caller unmounts.\n const closeDialog = useDialogClose(onClose);\n\n const onActionButtonClick = useCallback(() => {\n if (isLast && onClose) {\n return onClose();\n }\n\n return onNextButtonClick && onNextButtonClick();\n }, [isLast, onClose, onNextButtonClick]);\n\n return !skip ? (\n <>\n <StyledStepHeader>\n <StyledStepHeaderLeft>\n {!disableBackButton && index && index > 0 ? (\n <StyledStepBackButton\n onClick={onPreviousButtonClick}\n variant=\"text gray\"\n disabled={changingStepInProgress}\n >\n <ArrowBackMobileIcon />\n </StyledStepBackButton>\n ) : null}\n <StyledStepTitle>\n <Caption2>{title}</Caption2>\n <Header3>{subtitle}</Header3>\n </StyledStepTitle>\n </StyledStepHeaderLeft>\n {customRightHeader ? (\n customRightHeader\n ) : (\n <IconButton\n onClick={closeDialog}\n variant=\"text gray\"\n disabled={changingStepInProgress}\n >\n <CancelCrossIcon />\n </IconButton>\n )}\n </StyledStepHeader>\n <Dialog.ContentDivider />\n {shouldRenderNextButton ? (\n <>\n <Dialog.Content>{children}</Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <StepActionButton\n isLast={isLast}\n actionLabel={actionLabel}\n onNextButtonClick={onActionButtonClick}\n />\n </Dialog.Actions>\n </>\n ) : (\n <StyledCustomStep>{children}</StyledCustomStep>\n )}\n </>\n ) : null;\n};\n\nStep.displayName = \"Step\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAkD,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,wBAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,I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jD,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACjD,WAAA,CAAA6D,UAAU;IACTP,OAAO,EAAET,WAAY;IACrBU,OAAO,EAAC,WAAW;IACnBC,QAAQ,EAAEjB;EAAuB,gBAEjC9C,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAAChD,MAAA,CAAA6D,eAAe,MAAE,CACR,CAEE,CAAC,eACnBrE,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACnD,OAAA,CAAAiE,MAAM,CAACC,cAAc,MAAE,CAAC,EACxB3B,sBAAsB,gBACrB5C,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAAAxD,MAAA,CAAAoB,OAAA,CAAAqC,QAAA,qBACEzD,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACnD,OAAA,CAAAiE,MAAM,CAACE,OAAO,QAAEhC,QAAyB,CAAC,eAC3CxC,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACnD,OAAA,CAAAiE,MAAM,CAACC,cAAc,MAAE,CAAC,eACzBvE,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACnD,OAAA,CAAAiE,MAAM,CAACG,OAAO,qBACbzE,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACrD,iBAAA,CAAAuE,gBAAgB;IACfxC,MAAM,EAAEA,MAAO;IACfQ,WAAW,EAAEA,WAAY;IACzBL,iBAAiB,EAAEiB;EAAoB,CACxC,CACa,CAChB,CAAC,gBAEHtD,MAAA,CAAAoB,OAAA,CAAAoC,aAAA,CAACpD,OAAA,CAAAuE,gBAAgB,QAAEnC,QAA2B,CAEhD,CAAC,GACD,IAAI;AACV,CAAC;AAEDV,IAAI,CAAC8C,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledStepTitle = exports.StyledStepHeaderLeft = exports.StyledStepHeader = exports.StyledCustomStep = void 0;
|
|
6
|
+
exports.StyledStepTitle = exports.StyledStepHeaderLeft = exports.StyledStepHeader = exports.StyledStepBackButton = exports.StyledCustomStep = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _IconButton = require("../IconButton");
|
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
10
|
var StyledStepHeader = exports.StyledStepHeader = _styledComponents.default.div.withConfig({
|
|
10
11
|
displayName: "Styles__StyledStepHeader",
|
|
@@ -25,4 +26,8 @@ var StyledCustomStep = exports.StyledCustomStep = _styledComponents.default.div.
|
|
|
25
26
|
displayName: "Styles__StyledCustomStep",
|
|
26
27
|
componentId: "sc-88drbd-3"
|
|
27
28
|
})(["display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden;"]);
|
|
29
|
+
var StyledStepBackButton = exports.StyledStepBackButton = (0, _styledComponents.default)(_IconButton.IconButton).withConfig({
|
|
30
|
+
displayName: "Styles__StyledStepBackButton",
|
|
31
|
+
componentId: "sc-88drbd-4"
|
|
32
|
+
})(["&&{margin-left:-0.75rem;margin-right:0.5rem;}"]);
|
|
28
33
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledStepHeader","exports","styled","div","withConfig","displayName","componentId","StyledStepTitle","StyledStepHeaderLeft","StyledCustomStep"],"sources":["../../../../src/components/Wizard/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const StyledStepHeader = styled.div`\n display: flex;\n padding: 12px 12px 12px 32px;\n justify-content: space-between;\n`;\n\nexport const StyledStepTitle = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n`;\n\nexport const StyledStepHeaderLeft = styled.div`\n display: flex;\n`;\n\n/* A step with its own footer holds Dialog.Content and Dialog.Actions, so it must\n fill the dialog and let the content scroll, not the step. */\nexport const StyledCustomStep = styled.div`\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireDefault","require","_IconButton","e","__esModule","default","StyledStepHeader","exports","styled","div","withConfig","displayName","componentId","StyledStepTitle","StyledStepHeaderLeft","StyledCustomStep","StyledStepBackButton","IconButton"],"sources":["../../../../src/components/Wizard/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { IconButton } from \"../IconButton\";\n\nexport const StyledStepHeader = styled.div`\n display: flex;\n padding: 12px 12px 12px 32px;\n justify-content: space-between;\n`;\n\nexport const StyledStepTitle = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n`;\n\nexport const StyledStepHeaderLeft = styled.div`\n display: flex;\n`;\n\n/* A step with its own footer holds Dialog.Content and Dialog.Actions, so it must\n fill the dialog and let the content scroll, not the step. */\nexport const StyledCustomStep = styled.div`\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n`;\n\nexport const StyledStepBackButton = styled(IconButton)`\n && {\n margin-left: -0.75rem;\n margin-right: 0.5rem;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAA2C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,IAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+EAIzC;AAEM,IAAMC,eAAe,GAAAN,OAAA,CAAAM,eAAA,GAAGL,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kEAIxC;AAEM,IAAME,oBAAoB,GAAAP,OAAA,CAAAO,oBAAA,GAAGN,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qBAE7C;;AAED;AACA;AACO,IAAMG,gBAAgB,GAAAR,OAAA,CAAAQ,gBAAA,GAAGP,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,sFAMzC;AAEM,IAAMI,oBAAoB,GAAAT,OAAA,CAAAS,oBAAA,GAAG,IAAAR,yBAAM,EAACS,sBAAU,CAAC,CAAAP,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qDAKrD","ignoreList":[]}
|
package/dist/cjs/utils/layers.js
CHANGED
|
@@ -3,11 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.layers = void 0;
|
|
6
|
+
exports.layers = exports.isInTopLayer = exports.getTopLayer = void 0;
|
|
7
7
|
var layers = exports.layers = {
|
|
8
8
|
cloud: 100000,
|
|
9
9
|
skyscraper: 1300,
|
|
10
10
|
tower: 1200,
|
|
11
11
|
house: 1000
|
|
12
12
|
};
|
|
13
|
+
var LAYER_SELECTOR = ".c-window";
|
|
14
|
+
|
|
15
|
+
/** The layer in front: the last open window, or null when the page itself is in front. */
|
|
16
|
+
var getTopLayer = exports.getTopLayer = function getTopLayer() {
|
|
17
|
+
var windows = document.querySelectorAll(LAYER_SELECTOR);
|
|
18
|
+
return windows.length ? windows[windows.length - 1] : null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut
|
|
23
|
+
* goes to the layer the user works in and never to a page or a window under it.
|
|
24
|
+
*/
|
|
25
|
+
var isInTopLayer = exports.isInTopLayer = function isInTopLayer(element) {
|
|
26
|
+
return element ? element.closest(LAYER_SELECTOR) === getTopLayer() : false;
|
|
27
|
+
};
|
|
13
28
|
//# sourceMappingURL=layers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layers.js","names":["layers","exports","cloud","skyscraper","tower","house"],"sources":["../../../src/utils/layers.ts"],"sourcesContent":["export const layers = {\n cloud: 100000,\n skyscraper: 1300,\n tower: 1200,\n house: 1000,\n};\n"],"mappings":";;;;;;AAAO,IAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,KAAK,EAAE;AACT,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"layers.js","names":["layers","exports","cloud","skyscraper","tower","house","LAYER_SELECTOR","getTopLayer","windows","document","querySelectorAll","length","isInTopLayer","element","closest"],"sources":["../../../src/utils/layers.ts"],"sourcesContent":["export const layers = {\n cloud: 100000,\n skyscraper: 1300,\n tower: 1200,\n house: 1000,\n};\n\nconst LAYER_SELECTOR = \".c-window\";\n\n/** The layer in front: the last open window, or null when the page itself is in front. */\nexport const getTopLayer = (): HTMLElement | null => {\n const windows = document.querySelectorAll<HTMLElement>(LAYER_SELECTOR);\n\n return windows.length ? windows[windows.length - 1] : null;\n};\n\n/**\n * True when the layer of the element is in front. A handler of a global shortcut asks this first, so the shortcut\n * goes to the layer the user works in and never to a page or a window under it.\n */\nexport const isInTopLayer = (element: Element | null | undefined) =>\n element ? element.closest(LAYER_SELECTOR) === getTopLayer() : false;\n"],"mappings":";;;;;;AAAO,IAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EACXC,KAAK,EAAE;AACT,CAAC;AAED,IAAMC,cAAc,GAAG,WAAW;;AAElC;AACO,IAAMC,WAAW,GAAAN,OAAA,CAAAM,WAAA,GAAG,SAAdA,WAAWA,CAAA,EAA6B;EACnD,IAAMC,OAAO,GAAGC,QAAQ,CAACC,gBAAgB,CAAcJ,cAAc,CAAC;EAEtE,OAAOE,OAAO,CAACG,MAAM,GAAGH,OAAO,CAACA,OAAO,CAACG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI;AAC5D,CAAC;;AAED;AACA;AACA;AACA;AACO,IAAMC,YAAY,GAAAX,OAAA,CAAAW,YAAA,GAAG,SAAfA,YAAYA,CAAIC,OAAmC;EAAA,OAC9DA,OAAO,GAAGA,OAAO,CAACC,OAAO,CAACR,cAAc,CAAC,KAAKC,WAAW,CAAC,CAAC,GAAG,KAAK;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _layers = require("./layers");
|
|
4
|
+
var addWindow = function addWindow() {
|
|
5
|
+
var node = document.createElement("div");
|
|
6
|
+
node.className = "c-window";
|
|
7
|
+
document.body.appendChild(node);
|
|
8
|
+
return node;
|
|
9
|
+
};
|
|
10
|
+
describe("layers", function () {
|
|
11
|
+
afterEach(function () {
|
|
12
|
+
document.body.innerHTML = "";
|
|
13
|
+
});
|
|
14
|
+
it("has the page in front when no window is open", function () {
|
|
15
|
+
var onPage = document.body.appendChild(document.createElement("input"));
|
|
16
|
+
expect((0, _layers.getTopLayer)()).toBeNull();
|
|
17
|
+
expect((0, _layers.isInTopLayer)(onPage)).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
it("has the last open window in front, and not the page or a window under it", function () {
|
|
20
|
+
var onPage = document.body.appendChild(document.createElement("input"));
|
|
21
|
+
var under = addWindow();
|
|
22
|
+
var inUnder = under.appendChild(document.createElement("input"));
|
|
23
|
+
var front = addWindow();
|
|
24
|
+
var inFront = front.appendChild(document.createElement("input"));
|
|
25
|
+
expect((0, _layers.getTopLayer)()).toBe(front);
|
|
26
|
+
expect((0, _layers.isInTopLayer)(inFront)).toBe(true);
|
|
27
|
+
expect((0, _layers.isInTopLayer)(inUnder)).toBe(false);
|
|
28
|
+
expect((0, _layers.isInTopLayer)(onPage)).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
it("is false for no element", function () {
|
|
31
|
+
expect((0, _layers.isInTopLayer)(null)).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=layers.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layers.test.js","names":["_layers","require","addWindow","node","document","createElement","className","body","appendChild","describe","afterEach","innerHTML","it","onPage","expect","getTopLayer","toBeNull","isInTopLayer","toBe","under","inUnder","front","inFront"],"sources":["../../../src/utils/layers.test.ts"],"sourcesContent":["import { getTopLayer, isInTopLayer } from \"./layers\";\n\nconst addWindow = () => {\n const node = document.createElement(\"div\");\n node.className = \"c-window\";\n document.body.appendChild(node);\n\n return node;\n};\n\ndescribe(\"layers\", () => {\n afterEach(() => {\n document.body.innerHTML = \"\";\n });\n\n it(\"has the page in front when no window is open\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBeNull();\n expect(isInTopLayer(onPage)).toBe(true);\n });\n\n it(\"has the last open window in front, and not the page or a window under it\", () => {\n const onPage = document.body.appendChild(document.createElement(\"input\"));\n const under = addWindow();\n const inUnder = under.appendChild(document.createElement(\"input\"));\n const front = addWindow();\n const inFront = front.appendChild(document.createElement(\"input\"));\n\n expect(getTopLayer()).toBe(front);\n expect(isInTopLayer(inFront)).toBe(true);\n expect(isInTopLayer(inUnder)).toBe(false);\n expect(isInTopLayer(onPage)).toBe(false);\n });\n\n it(\"is false for no element\", () => {\n expect(isInTopLayer(null)).toBe(false);\n });\n});\n"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAA,EAAS;EACtB,IAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,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AAY,EAACG,OAAO,CAAC,CAAC,CAACF,IAAI,CAAC,KAAK,CAAC;IACzCJ,MAAM,CAAC,IAAAG,oBAAY,EAACJ,MAAM,CAAC,CAAC,CAACK,IAAI,CAAC,KAAK,CAAC;EAC1C,CAAC,CAAC;EAEFN,EAAE,CAAC,yBAAyB,EAAE,YAAM;IAClCE,MAAM,CAAC,IAAAG,oBAAY,EAAC,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACxC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaretButton.d.ts","sourceRoot":"","sources":["../../../../src/components/CaretButton/CaretButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"CaretButton.d.ts","sourceRoot":"","sources":["../../../../src/components/CaretButton/CaretButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,WAAW,EACX,cAAc,GAAG,mBAAmB,CACrC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW;;2CAatB,CAAC"}
|
|
@@ -3,8 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["children", "className"];
|
|
4
4
|
import React, { forwardRef } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
|
-
import { StyledCaretButton } from "./Styles";
|
|
7
|
-
import { CollapseExpandSingleIcon } from "../Icons";
|
|
6
|
+
import { StyledCaretButton, StyledCaretIcon } from "./Styles";
|
|
8
7
|
const CARET_SIZE = 16;
|
|
9
8
|
|
|
10
9
|
// The caret sits in a 24 unit box and its shape is 10 units wide, so about 5px of its box is air.
|
|
@@ -31,10 +30,9 @@ export const CaretButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
31
30
|
return /*#__PURE__*/React.createElement(StyledCaretButton, _extends({
|
|
32
31
|
ref: ref,
|
|
33
32
|
className: classnames("c-caret-btn", className),
|
|
34
|
-
endAdornment: /*#__PURE__*/React.createElement(
|
|
33
|
+
endAdornment: /*#__PURE__*/React.createElement(StyledCaretIcon, {
|
|
35
34
|
width: CARET_SIZE,
|
|
36
|
-
height: CARET_SIZE
|
|
37
|
-
className: "tw-rotate-180"
|
|
35
|
+
height: CARET_SIZE
|
|
38
36
|
}),
|
|
39
37
|
endAdornmentInset: CARET_INSET
|
|
40
38
|
}, rest), children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaretButton.js","names":["React","forwardRef","classnames","StyledCaretButton","
|
|
1
|
+
{"version":3,"file":"CaretButton.js","names":["React","forwardRef","classnames","StyledCaretButton","StyledCaretIcon","CARET_SIZE","CARET_INSET","CaretButton","_ref","ref","children","className","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","endAdornment","width","height","endAdornmentInset","displayName"],"sources":["../../../../src/components/CaretButton/CaretButton.tsx"],"sourcesContent":["import React, { forwardRef, PropsWithChildren } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledCaretButton, StyledCaretIcon } from \"./Styles\";\nimport { ButtonProps } from \"../Button\";\n\nconst CARET_SIZE = 16;\n\n// The caret sits in a 24 unit box and its shape is 10 units wide, so about 5px of its box is air.\nconst CARET_INSET = 5;\n\nexport type CaretButtonProps = Omit<\n ButtonProps,\n \"endAdornment\" | \"endAdornmentInset\"\n>;\n\n/**\n * @component CaretButton\n * @description\n * A button that opens something: a menu, a picker, a panel. It always draws a caret after its\n * label, pulls that caret back by the whitespace inside its own box, and keeps four more pixels\n * on each side than a plain button. Both sides then look the same.\n *\n * @example\n * return (\n * <CaretButton variant=\"text gray\" onClick={openMenu}>\n * <ToolsIcon />\n * Tools\n * </CaretButton>\n * )\n */\nexport const CaretButton = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<CaretButtonProps>\n>(({ children, className, ...rest }, ref) => (\n <StyledCaretButton\n ref={ref}\n className={classnames(\"c-caret-btn\", className)}\n endAdornment={<StyledCaretIcon width={CARET_SIZE} height={CARET_SIZE} />}\n endAdornmentInset={CARET_INSET}\n {...rest}\n >\n {children}\n </StyledCaretButton>\n));\n\nCaretButton.displayName = \"CaretButton\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAA2B,OAAO;AAE5D,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,UAAU;AAG7D,MAAMC,UAAU,GAAG,EAAE;;AAErB;AACA,MAAMC,WAAW,GAAG,CAAC;AAOrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,gBAAGN,UAAU,CAGnC,CAAAO,IAAA,EAAmCC,GAAG;EAAA,IAAnCC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAKC,IAAI,GAAAC,6BAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBAC/Bd,KAAA,CAAAe,aAAA,CAACZ,iBAAiB,EAAAa,QAAA;IAChBP,GAAG,EAAEA,GAAI;IACTE,SAAS,EAAET,UAAU,CAAC,aAAa,EAAES,SAAS,CAAE;IAChDM,YAAY,eAAEjB,KAAA,CAAAe,aAAA,CAACX,eAAe;MAACc,KAAK,EAAEb,UAAW;MAACc,MAAM,EAAEd;IAAW,CAAE,CAAE;IACzEe,iBAAiB,EAAEd;EAAY,GAC3BM,IAAI,GAEPF,QACgB,CAAC;AAAA,CACrB,CAAC;AAEFH,WAAW,CAACc,WAAW,GAAG,aAAa","ignoreList":[]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const StyledCaretButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").ButtonProps & {
|
|
2
2
|
children?: import("react").ReactNode | undefined;
|
|
3
3
|
} & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
4
|
+
export declare const StyledCaretIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement> & {
|
|
5
|
+
gradient?: string;
|
|
6
|
+
}, "ref"> & import("react").RefAttributes<SVGSVGElement>>, any, {}, never>;
|
|
4
7
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/CaretButton/Styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/CaretButton/Styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;sEAE7B,CAAC;AAIF,eAAO,MAAM,eAAe;;0EAE3B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { Button } from "../Button";
|
|
3
|
+
import { CollapseExpandSingleIcon } from "../Icons";
|
|
3
4
|
|
|
4
5
|
// A caret button carries four more pixels on each side than a plain button, so the caret does
|
|
5
6
|
// not crowd the edge.
|
|
@@ -11,4 +12,9 @@ export const StyledCaretButton = styled(Button).withConfig({
|
|
|
11
12
|
"paddingRight": "0.75rem"
|
|
12
13
|
});
|
|
13
14
|
StyledCaretButton.displayName = "StyledCaretButton";
|
|
15
|
+
export const StyledCaretIcon = styled(CollapseExpandSingleIcon).withConfig({
|
|
16
|
+
displayName: "Styles__StyledCaretIcon",
|
|
17
|
+
componentId: "sc-11aoinc-1"
|
|
18
|
+
})(["transform:rotate(180deg);"]);
|
|
19
|
+
StyledCaretIcon.displayName = "StyledCaretIcon";
|
|
14
20
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","Button","StyledCaretButton","withConfig","displayName","componentId"],"sources":["../../../../src/components/CaretButton/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { Button } from \"../Button\";\n\n// A caret button carries four more pixels on each side than a plain button, so the caret does\n// not crowd the edge.\nexport const StyledCaretButton = styled(Button)`\n ${tw`tw-px-3`}\n`;\n\nStyledCaretButton.displayName = \"StyledCaretButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAGtC,SAASC,MAAM,QAAQ,WAAW;;
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","Button","CollapseExpandSingleIcon","StyledCaretButton","withConfig","displayName","componentId","StyledCaretIcon"],"sources":["../../../../src/components/CaretButton/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { Button } from \"../Button\";\nimport { CollapseExpandSingleIcon } from \"../Icons\";\n\n// A caret button carries four more pixels on each side than a plain button, so the caret does\n// not crowd the edge.\nexport const StyledCaretButton = styled(Button)`\n ${tw`tw-px-3`}\n`;\n\nStyledCaretButton.displayName = \"StyledCaretButton\";\n\nexport const StyledCaretIcon = styled(CollapseExpandSingleIcon)`\n transform: rotate(180deg);\n`;\n\nStyledCaretIcon.displayName = \"StyledCaretIcon\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAGtC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,wBAAwB,QAAQ,UAAU;;AAEnD;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGH,MAAM,CAACC,MAAM,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACzC;EAAA;EAAA;AAAQ,CAAC,CACd;AAEDH,iBAAiB,CAACE,WAAW,GAAG,mBAAmB;AAEnD,OAAO,MAAME,eAAe,GAAGP,MAAM,CAACE,wBAAwB,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,iCAE9D;AAEDC,eAAe,CAACF,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CounterButton.d.ts","sourceRoot":"","sources":["../../../../src/components/CounterButton/CounterButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAcxD,MAAM,WAAW,mBAAmB;IAClC,uBAAuB;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,UAAU,EAAE,CAAC,KAAK,CAAC,KAAA,KAAK,IAAI,CAAC;IAC7B,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"CounterButton.d.ts","sourceRoot":"","sources":["../../../../src/components/CounterButton/CounterButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAcxD,MAAM,WAAW,mBAAmB;IAClC,uBAAuB;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,UAAU,EAAE,CAAC,KAAK,CAAC,KAAA,KAAK,IAAI,CAAC;IAC7B,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,4FA8DzB,CAAC"}
|
|
@@ -44,8 +44,7 @@ export const CounterButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
44
44
|
dimension: 16,
|
|
45
45
|
value: counter
|
|
46
46
|
}) : null), counter > 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
47
|
-
title: "" + tooltipText
|
|
48
|
-
popperTooltipClassName: "z-index-1300"
|
|
47
|
+
title: "" + tooltipText
|
|
49
48
|
}, /*#__PURE__*/React.createElement(StyledCounterButtonReset, {
|
|
50
49
|
variant: "text colored",
|
|
51
50
|
className: "c-counter-button__reset",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CounterButton.js","names":["React","forwardRef","classNames","StyledBadge","StyledCounterButton","StyledCounterButtonLabel","StyledCounterButtonReset","StyledCounterButtonWrapper","CloseSmallIcon","Tooltip","CounterButton","_ref","ref","label","icon","active","_ref$counter","counter","tooltipText","onClearAll","className","labelClassName","_ref$disabled","disabled","args","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","variant","$active","$selected","cloneElement","color","weight","isStandalone","dimension","value","title","
|
|
1
|
+
{"version":3,"file":"CounterButton.js","names":["React","forwardRef","classNames","StyledBadge","StyledCounterButton","StyledCounterButtonLabel","StyledCounterButtonReset","StyledCounterButtonWrapper","CloseSmallIcon","Tooltip","CounterButton","_ref","ref","label","icon","active","_ref$counter","counter","tooltipText","onClearAll","className","labelClassName","_ref$disabled","disabled","args","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","variant","$active","$selected","cloneElement","color","weight","isStandalone","dimension","value","title","onClick","iconOnly","displayName"],"sources":["../../../../src/components/CounterButton/CounterButton.tsx"],"sourcesContent":["import React, { forwardRef, ReactElement } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport {\n StyledBadge,\n StyledCounterButton,\n StyledCounterButtonLabel,\n StyledCounterButtonReset,\n StyledCounterButtonWrapper,\n} from \"./Styles\";\nimport CloseSmallIcon from \"../Icons/collection/CloseSmall\";\nimport { Tooltip } from \"../Tooltip/Tooltip\";\n\nexport interface ICounterButtonProps {\n /** Set active state */\n active?: boolean;\n /** Label for value */\n label?: string;\n /** Icon */\n icon?: ReactElement;\n /** Number of applied filters */\n counter?: number;\n /** OnClearAll callback */\n onClearAll: (event?) => void;\n /** Tooltip content */\n tooltipText?: string;\n /** Applies passed classes */\n className?: string;\n /** Applies passed classes for label text */\n labelClassName?: string;\n /** Disabled state of a button */\n disabled?: boolean;\n}\n\nexport const CounterButton = forwardRef<HTMLDivElement, ICounterButtonProps>(\n (\n {\n label,\n icon,\n active,\n counter = 0,\n tooltipText,\n onClearAll,\n className,\n labelClassName,\n disabled = false,\n ...args\n },\n ref\n ) => {\n return (\n <StyledCounterButtonWrapper ref={ref} className={className}>\n <StyledCounterButton\n disabled={disabled}\n aria-disabled={disabled}\n className={classNames(\"c-counter-button\", {\n \"c-counter-button__selected\": counter,\n })}\n {...args}\n variant=\"text gray\"\n $active={counter > 0 || active}\n $selected={counter > 0}\n >\n {icon &&\n React.cloneElement(icon, {\n className: classNames(\"c-counter-button__icon\"),\n })}\n {label && (\n <StyledCounterButtonLabel\n color=\"secondary\"\n weight=\"medium\"\n className={classNames(\"c-counter-button__label\", labelClassName)}\n $active={counter > 0 || active}\n >\n {label}\n </StyledCounterButtonLabel>\n )}\n {counter > 0 ? (\n <StyledBadge isStandalone={true} dimension={16} value={counter} />\n ) : null}\n </StyledCounterButton>\n {counter > 0 ? (\n <Tooltip title={`${tooltipText}`}>\n <StyledCounterButtonReset\n variant=\"text colored\"\n className=\"c-counter-button__reset\"\n onClick={onClearAll}\n iconOnly\n >\n <CloseSmallIcon />\n </StyledCounterButtonReset>\n </Tooltip>\n ) : null}\n </StyledCounterButtonWrapper>\n );\n }\n);\n\nCounterButton.displayName = \"CounterButton\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAsB,OAAO;AAEvD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,WAAW,EACXC,mBAAmB,EACnBC,wBAAwB,EACxBC,wBAAwB,EACxBC,0BAA0B,QACrB,UAAU;AACjB,OAAOC,cAAc,MAAM,gCAAgC;AAC3D,SAASC,OAAO,QAAQ,oBAAoB;AAuB5C,OAAO,MAAMC,aAAa,gBAAGT,UAAU,CACrC,CAAAU,IAAA,EAaEC,GAAG,KACA;EAAA,IAZDC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAAC,YAAA,GAAAL,IAAA,CACNM,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,GAAAA,YAAA;IACXE,WAAW,GAAAP,IAAA,CAAXO,WAAW;IACXC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,SAAS,GAAAT,IAAA,CAATS,SAAS;IACTC,cAAc,GAAAV,IAAA,CAAdU,cAAc;IAAAC,aAAA,GAAAX,IAAA,CACdY,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAG,KAAK,GAAAA,aAAA;IACbE,IAAI,GAAAC,6BAAA,CAAAd,IAAA,EAAAe,SAAA;EAIT,oBACE1B,KAAA,CAAA2B,aAAA,CAACpB,0BAA0B;IAACK,GAAG,EAAEA,GAAI;IAACQ,SAAS,EAAEA;EAAU,gBACzDpB,KAAA,CAAA2B,aAAA,CAACvB,mBAAmB,EAAAwB,QAAA;IAClBL,QAAQ,EAAEA,QAAS;IACnB,iBAAeA,QAAS;IACxBH,SAAS,EAAElB,UAAU,CAAC,kBAAkB,EAAE;MACxC,4BAA4B,EAAEe;IAChC,CAAC;EAAE,GACCO,IAAI;IACRK,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAEb,OAAO,GAAG,CAAC,IAAIF,MAAO;IAC/BgB,SAAS,EAAEd,OAAO,GAAG;EAAE,IAEtBH,IAAI,iBACHd,KAAK,CAACgC,YAAY,CAAClB,IAAI,EAAE;IACvBM,SAAS,EAAElB,UAAU,CAAC,wBAAwB;EAChD,CAAC,CAAC,EACHW,KAAK,iBACJb,KAAA,CAAA2B,aAAA,CAACtB,wBAAwB;IACvB4B,KAAK,EAAC,WAAW;IACjBC,MAAM,EAAC,QAAQ;IACfd,SAAS,EAAElB,UAAU,CAAC,yBAAyB,EAAEmB,cAAc,CAAE;IACjES,OAAO,EAAEb,OAAO,GAAG,CAAC,IAAIF;EAAO,GAE9BF,KACuB,CAC3B,EACAI,OAAO,GAAG,CAAC,gBACVjB,KAAA,CAAA2B,aAAA,CAACxB,WAAW;IAACgC,YAAY,EAAE,IAAK;IAACC,SAAS,EAAE,EAAG;IAACC,KAAK,EAAEpB;EAAQ,CAAE,CAAC,GAChE,IACe,CAAC,EACrBA,OAAO,GAAG,CAAC,gBACVjB,KAAA,CAAA2B,aAAA,CAAClB,OAAO;IAAC6B,KAAK,OAAKpB;EAAc,gBAC/BlB,KAAA,CAAA2B,aAAA,CAACrB,wBAAwB;IACvBuB,OAAO,EAAC,cAAc;IACtBT,SAAS,EAAC,yBAAyB;IACnCmB,OAAO,EAAEpB,UAAW;IACpBqB,QAAQ;EAAA,gBAERxC,KAAA,CAAA2B,aAAA,CAACnB,cAAc,MAAE,CACO,CACnB,CAAC,GACR,IACsB,CAAC;AAEjC,CACF,CAAC;AAEDE,aAAa,CAAC+B,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -100,9 +100,7 @@ export const EditableHours = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
100
100
|
type: "text"
|
|
101
101
|
}),
|
|
102
102
|
$ticking: ticking
|
|
103
|
-
}, rest), ticking && /*#__PURE__*/React.createElement(React.Fragment, null, splitTime == null ? void 0 : splitTime.hours, /*#__PURE__*/React.createElement("span",
|
|
104
|
-
className: "tw-animate-ping"
|
|
105
|
-
}, ":"), splitTime == null ? void 0 : splitTime.minutes));
|
|
103
|
+
}, rest), ticking && /*#__PURE__*/React.createElement(React.Fragment, null, splitTime == null ? void 0 : splitTime.hours, /*#__PURE__*/React.createElement("span", null, ":"), splitTime == null ? void 0 : splitTime.minutes));
|
|
106
104
|
});
|
|
107
105
|
EditableHours.displayName = "EditableHours";
|
|
108
106
|
//# sourceMappingURL=EditableHours.js.map
|