@cdx-ui/components 0.1.7 → 0.2.1
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/coverage.svg +1 -1
- package/lib/commonjs/components/Calendar/flashCalendarAdapter.js +18 -0
- package/lib/commonjs/components/Calendar/flashCalendarAdapter.js.map +1 -1
- package/lib/commonjs/components/Calendar/index.js +32 -3
- package/lib/commonjs/components/Calendar/index.js.map +1 -1
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.js +78 -0
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.js.map +1 -0
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.web.js +31 -0
- package/lib/commonjs/components/ColorArea/ColorAreaPaint.web.js.map +1 -0
- package/lib/commonjs/components/ColorArea/index.js +57 -0
- package/lib/commonjs/components/ColorArea/index.js.map +1 -0
- package/lib/commonjs/components/ColorArea/styles.js +12 -0
- package/lib/commonjs/components/ColorArea/styles.js.map +1 -0
- package/lib/commonjs/components/ColorField/index.js +138 -0
- package/lib/commonjs/components/ColorField/index.js.map +1 -0
- package/lib/commonjs/components/ColorField/styles.js +14 -0
- package/lib/commonjs/components/ColorField/styles.js.map +1 -0
- package/lib/commonjs/components/ColorPicker/index.js +88 -0
- package/lib/commonjs/components/ColorPicker/index.js.map +1 -0
- package/lib/commonjs/components/ColorPicker/styles.js +22 -0
- package/lib/commonjs/components/ColorPicker/styles.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.js +68 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.web.js +41 -0
- package/lib/commonjs/components/ColorSlider/ColorSliderRailPaint.web.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/index.js +123 -0
- package/lib/commonjs/components/ColorSlider/index.js.map +1 -0
- package/lib/commonjs/components/ColorSlider/styles.js +50 -0
- package/lib/commonjs/components/ColorSlider/styles.js.map +1 -0
- package/lib/commonjs/components/ColorSwatch/index.js +54 -0
- package/lib/commonjs/components/ColorSwatch/index.js.map +1 -0
- package/lib/commonjs/components/ColorSwatch/styles.js +25 -0
- package/lib/commonjs/components/ColorSwatch/styles.js.map +1 -0
- package/lib/commonjs/components/ColorSwatchPicker/index.js +110 -0
- package/lib/commonjs/components/ColorSwatchPicker/index.js.map +1 -0
- package/lib/commonjs/components/ColorSwatchPicker/styles.js +17 -0
- package/lib/commonjs/components/ColorSwatchPicker/styles.js.map +1 -0
- package/lib/commonjs/components/DatePicker/index.js +2 -0
- package/lib/commonjs/components/DatePicker/index.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +4 -2
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +3 -0
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +27 -3
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Icon/styles.js +19 -0
- package/lib/commonjs/components/Icon/styles.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +13 -4
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +39 -3
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/Toast/hooks.js +0 -1
- package/lib/commonjs/components/Toast/hooks.js.map +1 -1
- package/lib/commonjs/components/Toast/index.js +9 -6
- package/lib/commonjs/components/Toast/index.js.map +1 -1
- package/lib/commonjs/components/Toast/styles.js +36 -19
- package/lib/commonjs/components/Toast/styles.js.map +1 -1
- package/lib/commonjs/components/ToggleButton/index.js +5 -4
- package/lib/commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib/commonjs/components/index.js +68 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/picker/surfaces.js +9 -2
- package/lib/commonjs/components/picker/surfaces.js.map +1 -1
- package/lib/commonjs/figma/Icon.figma.js +30 -3
- package/lib/commonjs/figma/Icon.figma.js.map +1 -1
- package/lib/commonjs/figma/Text.figma.js +15 -1
- package/lib/commonjs/figma/Text.figma.js.map +1 -1
- package/lib/commonjs/providers/toast/insets-container.js +15 -3
- package/lib/commonjs/providers/toast/insets-container.js.map +1 -1
- package/lib/commonjs/providers/toast/provider.js +1 -0
- package/lib/commonjs/providers/toast/provider.js.map +1 -1
- package/lib/commonjs/styles/constants.js +14 -1
- package/lib/commonjs/styles/constants.js.map +1 -1
- package/lib/module/components/Calendar/flashCalendarAdapter.js +17 -0
- package/lib/module/components/Calendar/flashCalendarAdapter.js.map +1 -1
- package/lib/module/components/Calendar/index.js +34 -5
- package/lib/module/components/Calendar/index.js.map +1 -1
- package/lib/module/components/ColorArea/ColorAreaPaint.js +74 -0
- package/lib/module/components/ColorArea/ColorAreaPaint.js.map +1 -0
- package/lib/module/components/ColorArea/ColorAreaPaint.web.js +27 -0
- package/lib/module/components/ColorArea/ColorAreaPaint.web.js.map +1 -0
- package/lib/module/components/ColorArea/index.js +53 -0
- package/lib/module/components/ColorArea/index.js.map +1 -0
- package/lib/module/components/ColorArea/styles.js +8 -0
- package/lib/module/components/ColorArea/styles.js.map +1 -0
- package/lib/module/components/ColorField/index.js +134 -0
- package/lib/module/components/ColorField/index.js.map +1 -0
- package/lib/module/components/ColorField/styles.js +10 -0
- package/lib/module/components/ColorField/styles.js.map +1 -0
- package/lib/module/components/ColorPicker/index.js +79 -0
- package/lib/module/components/ColorPicker/index.js.map +1 -0
- package/lib/module/components/ColorPicker/styles.js +18 -0
- package/lib/module/components/ColorPicker/styles.js.map +1 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.js +64 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.js.map +1 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.web.js +37 -0
- package/lib/module/components/ColorSlider/ColorSliderRailPaint.web.js.map +1 -0
- package/lib/module/components/ColorSlider/index.js +119 -0
- package/lib/module/components/ColorSlider/index.js.map +1 -0
- package/lib/module/components/ColorSlider/styles.js +46 -0
- package/lib/module/components/ColorSlider/styles.js.map +1 -0
- package/lib/module/components/ColorSwatch/index.js +50 -0
- package/lib/module/components/ColorSwatch/index.js.map +1 -0
- package/lib/module/components/ColorSwatch/styles.js +21 -0
- package/lib/module/components/ColorSwatch/styles.js.map +1 -0
- package/lib/module/components/ColorSwatchPicker/index.js +106 -0
- package/lib/module/components/ColorSwatchPicker/index.js.map +1 -0
- package/lib/module/components/ColorSwatchPicker/styles.js +13 -0
- package/lib/module/components/ColorSwatchPicker/styles.js.map +1 -0
- package/lib/module/components/DatePicker/index.js +2 -0
- package/lib/module/components/DatePicker/index.js.map +1 -1
- package/lib/module/components/Field/index.js +4 -2
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Heading/styles.js +3 -0
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +27 -3
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Icon/styles.js +16 -0
- package/lib/module/components/Icon/styles.js.map +1 -0
- package/lib/module/components/Text/index.js +14 -5
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Text/styles.js +38 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/Toast/hooks.js +0 -1
- package/lib/module/components/Toast/hooks.js.map +1 -1
- package/lib/module/components/Toast/index.js +10 -7
- package/lib/module/components/Toast/index.js.map +1 -1
- package/lib/module/components/Toast/styles.js +35 -19
- package/lib/module/components/Toast/styles.js.map +1 -1
- package/lib/module/components/ToggleButton/index.js +3 -3
- package/lib/module/components/ToggleButton/index.js.map +1 -1
- package/lib/module/components/index.js +6 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/picker/surfaces.js +10 -3
- package/lib/module/components/picker/surfaces.js.map +1 -1
- package/lib/module/figma/Icon.figma.js +30 -3
- package/lib/module/figma/Icon.figma.js.map +1 -1
- package/lib/module/figma/Text.figma.js +15 -1
- package/lib/module/figma/Text.figma.js.map +1 -1
- package/lib/module/providers/toast/insets-container.js +15 -4
- package/lib/module/providers/toast/insets-container.js.map +1 -1
- package/lib/module/providers/toast/provider.js +2 -1
- package/lib/module/providers/toast/provider.js.map +1 -1
- package/lib/module/styles/constants.js +13 -0
- package/lib/module/styles/constants.js.map +1 -1
- package/lib/typescript/components/Alert/index.d.ts +1 -1
- package/lib/typescript/components/Alert/index.d.ts.map +1 -1
- package/lib/typescript/components/Avatar/index.d.ts +1 -1
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/components/Badge/styles.d.ts +3 -3
- package/lib/typescript/components/Breadcrumbs/styles.d.ts +1 -1
- package/lib/typescript/components/Button/index.d.ts +1 -1
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +4 -4
- package/lib/typescript/components/Calendar/flashCalendarAdapter.d.ts +3 -1
- package/lib/typescript/components/Calendar/flashCalendarAdapter.d.ts.map +1 -1
- package/lib/typescript/components/Calendar/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +1 -1
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +3 -3
- package/lib/typescript/components/ColorArea/ColorAreaPaint.d.ts +5 -0
- package/lib/typescript/components/ColorArea/ColorAreaPaint.d.ts.map +1 -0
- package/lib/typescript/components/ColorArea/ColorAreaPaint.web.d.ts +5 -0
- package/lib/typescript/components/ColorArea/ColorAreaPaint.web.d.ts.map +1 -0
- package/lib/typescript/components/ColorArea/index.d.ts +20 -0
- package/lib/typescript/components/ColorArea/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorArea/styles.d.ts +4 -0
- package/lib/typescript/components/ColorArea/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorField/index.d.ts +41 -0
- package/lib/typescript/components/ColorField/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorField/styles.d.ts +13 -0
- package/lib/typescript/components/ColorField/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorPicker/index.d.ts +28 -0
- package/lib/typescript/components/ColorPicker/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorPicker/styles.d.ts +9 -0
- package/lib/typescript/components/ColorPicker/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.d.ts +5 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.web.d.ts +5 -0
- package/lib/typescript/components/ColorSlider/ColorSliderRailPaint.web.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/index.d.ts +33 -0
- package/lib/typescript/components/ColorSlider/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorSlider/styles.d.ts +14 -0
- package/lib/typescript/components/ColorSlider/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatch/index.d.ts +19 -0
- package/lib/typescript/components/ColorSwatch/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatch/styles.d.ts +7 -0
- package/lib/typescript/components/ColorSwatch/styles.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatchPicker/index.d.ts +37 -0
- package/lib/typescript/components/ColorSwatchPicker/index.d.ts.map +1 -0
- package/lib/typescript/components/ColorSwatchPicker/styles.d.ts +5 -0
- package/lib/typescript/components/ColorSwatchPicker/styles.d.ts.map +1 -0
- package/lib/typescript/components/DatePicker/index.d.ts +1 -1
- package/lib/typescript/components/DatePicker/index.d.ts.map +1 -1
- package/lib/typescript/components/Divider/index.d.ts +1 -1
- package/lib/typescript/components/Divider/index.d.ts.map +1 -1
- package/lib/typescript/components/Field/index.d.ts +5 -0
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
- package/lib/typescript/components/Icon/index.d.ts +14 -22
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/Icon/styles.d.ts +6 -0
- package/lib/typescript/components/Icon/styles.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/styles.d.ts +2 -2
- package/lib/typescript/components/Input/index.d.ts +1 -1
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +1 -1
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts +2 -2
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +1 -1
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Slider/styles.d.ts +3 -3
- package/lib/typescript/components/Text/index.d.ts +40 -3
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts +9 -0
- package/lib/typescript/components/Text/styles.d.ts.map +1 -1
- package/lib/typescript/components/Toast/hooks.d.ts +1 -1
- package/lib/typescript/components/Toast/hooks.d.ts.map +1 -1
- package/lib/typescript/components/Toast/index.d.ts.map +1 -1
- package/lib/typescript/components/Toast/styles.d.ts +4 -0
- package/lib/typescript/components/Toast/styles.d.ts.map +1 -1
- package/lib/typescript/components/Toast/types.d.ts +1 -1
- package/lib/typescript/components/Toast/types.d.ts.map +1 -1
- package/lib/typescript/components/ToggleButton/index.d.ts +5 -3
- package/lib/typescript/components/ToggleButton/index.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +6 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/picker/surfaces.d.ts +5 -1
- package/lib/typescript/components/picker/surfaces.d.ts.map +1 -1
- package/lib/typescript/figma/Icon.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Text.figma.d.ts.map +1 -1
- package/lib/typescript/providers/toast/insets-container.d.ts +12 -0
- package/lib/typescript/providers/toast/insets-container.d.ts.map +1 -1
- package/lib/typescript/providers/toast/types.d.ts +5 -0
- package/lib/typescript/providers/toast/types.d.ts.map +1 -1
- package/lib/typescript/styles/constants.d.ts +10 -0
- package/lib/typescript/styles/constants.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Alert/index.tsx +1 -1
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Button/index.tsx +1 -1
- package/src/components/Calendar/flashCalendarAdapter.ts +13 -1
- package/src/components/Calendar/index.tsx +43 -5
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Chip/index.tsx +1 -1
- package/src/components/ColorArea/ColorAreaPaint.tsx +51 -0
- package/src/components/ColorArea/ColorAreaPaint.web.tsx +31 -0
- package/src/components/ColorArea/index.tsx +71 -0
- package/src/components/ColorArea/styles.ts +18 -0
- package/src/components/ColorField/index.tsx +181 -0
- package/src/components/ColorField/styles.ts +20 -0
- package/src/components/ColorPicker/index.tsx +110 -0
- package/src/components/ColorPicker/styles.ts +33 -0
- package/src/components/ColorSlider/ColorSliderRailPaint.tsx +60 -0
- package/src/components/ColorSlider/ColorSliderRailPaint.web.tsx +33 -0
- package/src/components/ColorSlider/index.tsx +147 -0
- package/src/components/ColorSlider/styles.ts +72 -0
- package/src/components/ColorSwatch/index.tsx +56 -0
- package/src/components/ColorSwatch/styles.ts +24 -0
- package/src/components/ColorSwatchPicker/index.tsx +150 -0
- package/src/components/ColorSwatchPicker/styles.ts +32 -0
- package/src/components/DatePicker/index.tsx +13 -3
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Field/index.tsx +9 -3
- package/src/components/Heading/styles.ts +3 -0
- package/src/components/Icon/index.tsx +46 -6
- package/src/components/Icon/styles.ts +15 -0
- package/src/components/Input/index.tsx +1 -1
- package/src/components/Link/index.tsx +1 -1
- package/src/components/Menu/index.tsx +2 -2
- package/src/components/Select/index.tsx +1 -1
- package/src/components/Text/index.tsx +32 -5
- package/src/components/Text/styles.ts +39 -1
- package/src/components/Toast/hooks.ts +0 -1
- package/src/components/Toast/index.tsx +14 -8
- package/src/components/Toast/styles.ts +47 -19
- package/src/components/Toast/types.ts +1 -1
- package/src/components/ToggleButton/index.tsx +9 -7
- package/src/components/index.ts +6 -0
- package/src/components/picker/surfaces.tsx +15 -2
- package/src/providers/toast/insets-container.tsx +23 -9
- package/src/providers/toast/provider.tsx +2 -2
- package/src/providers/toast/types.ts +5 -0
- package/src/styles/constants.ts +13 -0
package/coverage.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="108" height="20" role="img" aria-label="coverage: 91.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="108" height="20" role="img" aria-label="coverage: 91.8%"><title>coverage: 91.8%</title><filter id="blur"><feGaussianBlur stdDeviation="16"/></filter><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="108" height="20" rx="3"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="47" height="20" fill="#4b0"/><rect width="108" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="315" y="150" fill-opacity=".8" filter="url(#blur)" textLength="510">coverage</text><text x="315" y="150" fill-opacity=".3" textLength="510">coverage</text></g><text x="315" y="140" textLength="510">coverage</text></g><g transform="scale(.1)"><g aria-hidden="true" fill="#010101"><text x="835" y="150" fill-opacity=".8" filter="url(#blur)" textLength="370">91.8%</text><text x="835" y="150" fill-opacity=".3" textLength="370">91.8%</text></g><text x="835" y="140" textLength="370">91.8%</text></g></g></svg>
|
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FLASH_CALENDAR_RANGE_DAY_SPACING = exports.FLASH_CALENDAR_DAY_HEIGHT = void 0;
|
|
7
7
|
exports.formatFlashCalendarWeekdayShort = formatFlashCalendarWeekdayShort;
|
|
8
|
+
exports.getMonthDateIds = getMonthDateIds;
|
|
8
9
|
exports.toCalendarDateId = toCalendarDateId;
|
|
9
10
|
exports.useFlashCalendarRangeTheme = useFlashCalendarRangeTheme;
|
|
10
11
|
exports.useFlashCalendarTheme = useFlashCalendarTheme;
|
|
11
12
|
var _react = require("react");
|
|
12
13
|
var _uniwind = require("uniwind");
|
|
14
|
+
var _formatters = require("@cdx-ui/formatters");
|
|
13
15
|
const DAY_SIZE = 36;
|
|
14
16
|
const DAY_RADIUS = DAY_SIZE / 2;
|
|
15
17
|
const CALENDAR_COLOR_VARS = ['--color-surface-action-strong', '--color-content-action-on-strong', '--color-content-tertiary', '--color-surface-action-subtle', '--color-content-primary', '--color-stroke-action', '--color-surface-action-subtle-hover', '--color-content-action'];
|
|
@@ -287,6 +289,22 @@ function formatFlashCalendarWeekdayShort(date, locale) {
|
|
|
287
289
|
}).format(date);
|
|
288
290
|
}
|
|
289
291
|
|
|
292
|
+
/** Every day of the month Flash Calendar renders; days of adjacent months render as blanks. */
|
|
293
|
+
function getMonthDateIds(monthId) {
|
|
294
|
+
const parts = (0, _formatters.parseMonthId)(monthId);
|
|
295
|
+
if (!parts) {
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
298
|
+
const daysInMonth = new Date(parts.year, parts.month, 0).getDate();
|
|
299
|
+
return Array.from({
|
|
300
|
+
length: daysInMonth
|
|
301
|
+
}, (_, index) => (0, _formatters.formatDateId)({
|
|
302
|
+
year: parts.year,
|
|
303
|
+
month: parts.month,
|
|
304
|
+
day: index + 1
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
|
|
290
308
|
/**
|
|
291
309
|
* Brands a raw Flash Calendar day id as a wire {@link DateId}. Flash Calendar
|
|
292
310
|
* always hands back `YYYY-MM-DD`, so this is the trusted third-party boundary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_uniwind","DAY_SIZE","DAY_RADIUS","CALENDAR_COLOR_VARS","CALENDAR_LENGTH_VARS","DAY_FONT_SIZE_FALLBACK","TODAY_BORDER_WIDTH_FALLBACK","DISABLED_OPACITY_FALLBACK","ROOT_FONT_SIZE_PX","tokenValue","resolved","cssVar","String","lengthToPx","fallback","Number","isFinite","trimmed","trim","numeric","parseFloat","endsWith","useFlashCalendarColors","surfaceActionStrong","contentActionOnStrong","contentTertiary","surfaceActionSubtle","contentPrimary","strokeAction","surfaceActionSubtleHover","contentAction","useCSSVariable","useMemo","useFlashCalendarLengths","textSm","borderWidthSelected","opacityDisabled","dayFontSize","todayBorderWidth","disabledOpacity","isSelectedDay","id","selectedDateId","undefined","selectedDayStyles","colors","container","borderRadius","borderWidth","backgroundColor","content","color","fontWeight","useFlashCalendarTheme","lengths","selected","rowMonth","height","paddingVertical","overflow","fontSize","opacity","rowWeek","paddingBottom","itemWeekName","itemDay","base","alignItems","justifyContent","idle","isPressed","today","borderColor","active","disabled","useFlashCalendarRangeTheme","range","itemDayContainer","activeDayFiller","padding","isEndpoint","startId","endId","isStartOfRange","isEndOfRange","isSingleDay","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","FLASH_CALENDAR_RANGE_DAY_SPACING","exports","FLASH_CALENDAR_DAY_HEIGHT","formatFlashCalendarWeekdayShort","date","locale","Intl","DateTimeFormat","weekday","format","toCalendarDateId"],"sourceRoot":"../../../../src","sources":["components/Calendar/flashCalendarAdapter.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","require","_uniwind","_formatters","DAY_SIZE","DAY_RADIUS","CALENDAR_COLOR_VARS","CALENDAR_LENGTH_VARS","DAY_FONT_SIZE_FALLBACK","TODAY_BORDER_WIDTH_FALLBACK","DISABLED_OPACITY_FALLBACK","ROOT_FONT_SIZE_PX","tokenValue","resolved","cssVar","String","lengthToPx","fallback","Number","isFinite","trimmed","trim","numeric","parseFloat","endsWith","useFlashCalendarColors","surfaceActionStrong","contentActionOnStrong","contentTertiary","surfaceActionSubtle","contentPrimary","strokeAction","surfaceActionSubtleHover","contentAction","useCSSVariable","useMemo","useFlashCalendarLengths","textSm","borderWidthSelected","opacityDisabled","dayFontSize","todayBorderWidth","disabledOpacity","isSelectedDay","id","selectedDateId","undefined","selectedDayStyles","colors","container","borderRadius","borderWidth","backgroundColor","content","color","fontWeight","useFlashCalendarTheme","lengths","selected","rowMonth","height","paddingVertical","overflow","fontSize","opacity","rowWeek","paddingBottom","itemWeekName","itemDay","base","alignItems","justifyContent","idle","isPressed","today","borderColor","active","disabled","useFlashCalendarRangeTheme","range","itemDayContainer","activeDayFiller","padding","isEndpoint","startId","endId","isStartOfRange","isEndOfRange","isSingleDay","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","FLASH_CALENDAR_RANGE_DAY_SPACING","exports","FLASH_CALENDAR_DAY_HEIGHT","formatFlashCalendarWeekdayShort","date","locale","Intl","DateTimeFormat","weekday","format","getMonthDateIds","monthId","parts","parseMonthId","daysInMonth","Date","year","month","getDate","Array","from","length","_","index","formatDateId","day","toCalendarDateId"],"sourceRoot":"../../../../src","sources":["components/Calendar/flashCalendarAdapter.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,MAAMG,QAAQ,GAAG,EAAE;AACnB,MAAMC,UAAU,GAAGD,QAAQ,GAAG,CAAC;AAE/B,MAAME,mBAAmB,GAAG,CAC1B,+BAA+B,EAC/B,kCAAkC,EAClC,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,uBAAuB,EACvB,qCAAqC,EACrC,wBAAwB,CACzB;AAED,MAAMC,oBAAoB,GAAG,CAAC,WAAW,EAAE,yBAAyB,EAAE,oBAAoB,CAAC;AAE3F,MAAMC,sBAAsB,GAAG,EAAE;AACjC,MAAMC,2BAA2B,GAAG,CAAC;AACrC,MAAM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;AACA;AACA;AACA;AACO,SAASG,gBAAgBA,CAAC3E,EAAU,EAAU;EACnD,OAAOA,EAAE;AACX","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Calendar = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _flashCalendar = require("@marceloterreiro/flash-calendar");
|
|
9
|
+
var _formatters = require("@cdx-ui/formatters");
|
|
9
10
|
var _primitives = require("@cdx-ui/primitives");
|
|
10
11
|
var _utils = require("@cdx-ui/utils");
|
|
11
12
|
var _CalendarMonthHeader = require("./CalendarMonthHeader");
|
|
@@ -66,6 +67,20 @@ const CalendarHeader = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
66
67
|
});
|
|
67
68
|
});
|
|
68
69
|
CalendarHeader.displayName = 'Calendar.Header';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Keeps the previous array while its contents are unchanged, so an inline `isDateUnavailable`
|
|
73
|
+
* (a new function every render) does not hand Flash Calendar a new array and re-layout the month.
|
|
74
|
+
*/
|
|
75
|
+
function useStableDateIds(ids) {
|
|
76
|
+
const ref = (0, _react.useRef)(ids);
|
|
77
|
+
const prev = ref.current;
|
|
78
|
+
const unchanged = prev === ids || ids !== undefined && prev?.length === ids.length && prev.every((id, index) => id === ids[index]);
|
|
79
|
+
if (!unchanged) {
|
|
80
|
+
ref.current = ids;
|
|
81
|
+
}
|
|
82
|
+
return ref.current;
|
|
83
|
+
}
|
|
69
84
|
const CalendarGrid = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
70
85
|
className,
|
|
71
86
|
style,
|
|
@@ -77,6 +92,7 @@ const CalendarGrid = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
77
92
|
monthId,
|
|
78
93
|
minValue,
|
|
79
94
|
maxValue,
|
|
95
|
+
isDateUnavailable,
|
|
80
96
|
disabled,
|
|
81
97
|
locale
|
|
82
98
|
} = (0, _primitives.useCalendarContext)();
|
|
@@ -87,11 +103,23 @@ const CalendarGrid = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
87
103
|
startId: value,
|
|
88
104
|
endId: value
|
|
89
105
|
}] : [], [value]);
|
|
106
|
+
|
|
107
|
+
// Bounds are disabled by Flash Calendar via calendarMinDateId / calendarMaxDateId.
|
|
108
|
+
const unavailableDateIds = useStableDateIds((0, _react.useMemo)(() => isDateUnavailable ? (0, _flashCalendarAdapter.getMonthDateIds)(monthId).filter(id => isDateUnavailable(id)) : undefined, [isDateUnavailable, monthId]));
|
|
109
|
+
const isDateUnavailableRef = (0, _react.useRef)(isDateUnavailable);
|
|
110
|
+
isDateUnavailableRef.current = isDateUnavailable;
|
|
90
111
|
const handleDayPress = (0, _react.useCallback)(dateId => {
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
const id = (0, _flashCalendarAdapter.toCalendarDateId)(dateId);
|
|
113
|
+
const rules = {
|
|
114
|
+
minValue,
|
|
115
|
+
maxValue,
|
|
116
|
+
isDateUnavailable: isDateUnavailableRef.current
|
|
117
|
+
};
|
|
118
|
+
if (disabled || (0, _formatters.getDateValidationReason)(id, rules)) {
|
|
119
|
+
return;
|
|
93
120
|
}
|
|
94
|
-
|
|
121
|
+
onValueChange?.(id);
|
|
122
|
+
}, [disabled, maxValue, minValue, onValueChange]);
|
|
95
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.CalendarGrid, {
|
|
96
124
|
ref: ref,
|
|
97
125
|
className: className,
|
|
@@ -103,6 +131,7 @@ const CalendarGrid = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
103
131
|
calendarActiveDateRanges: activeRanges,
|
|
104
132
|
calendarMinDateId: minValue,
|
|
105
133
|
calendarMaxDateId: maxValue,
|
|
134
|
+
calendarDisabledDateIds: unavailableDateIds,
|
|
106
135
|
calendarMonthHeaderHeight: 0,
|
|
107
136
|
calendarDayHeight: _flashCalendarAdapter.FLASH_CALENDAR_DAY_HEIGHT,
|
|
108
137
|
calendarWeekHeaderHeight: 28,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_flashCalendar","_primitives","_utils","_CalendarMonthHeader","_CalendarYearPickerGrid","_flashCalendarAdapter","_styles","_jsxRuntime","CalendarDefaultBody","view","useCalendarContext","jsxs","Fragment","children","jsx","CalendarHeader","CalendarYearPicker","CalendarGrid","CalendarRoot","forwardRef","className","style","props","ref","cn","calendarRootVariants","mergeDataAttributes","dataAttributes","slot","displayName","monthId","onMonthIdChange","disabled","setView","locale","labels","CalendarMonthHeader","onViewChange","value","onValueChange","minValue","maxValue","instanceId","useId","theme","useFlashCalendarTheme","formatWeekday","useCallback","date","formatFlashCalendarWeekdayShort","activeRanges","useMemo","startId","endId","handleDayPress","dateId","toCalendarDateId","Calendar","calendarInstanceId","calendarMonthId","calendarActiveDateRanges","calendarMinDateId","calendarMaxDateId","calendarMonthHeaderHeight","calendarDayHeight","FLASH_CALENDAR_DAY_HEIGHT","calendarWeekHeaderHeight","calendarRowVerticalSpacing","calendarRowHorizontalSpacing","getCalendarMonthFormat","getCalendarWeekDayFormat","onCalendarDayPress","CalendarYearPickerGrid","exports","Object","assign","Header","Grid","YearPicker"],"sourceRoot":"../../../../src","sources":["components/Calendar/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","require","_flashCalendar","_formatters","_primitives","_utils","_CalendarMonthHeader","_CalendarYearPickerGrid","_flashCalendarAdapter","_styles","_jsxRuntime","CalendarDefaultBody","view","useCalendarContext","jsxs","Fragment","children","jsx","CalendarHeader","CalendarYearPicker","CalendarGrid","CalendarRoot","forwardRef","className","style","props","ref","cn","calendarRootVariants","mergeDataAttributes","dataAttributes","slot","displayName","monthId","onMonthIdChange","disabled","setView","locale","labels","CalendarMonthHeader","onViewChange","useStableDateIds","ids","useRef","prev","current","unchanged","undefined","length","every","id","index","value","onValueChange","minValue","maxValue","isDateUnavailable","instanceId","useId","theme","useFlashCalendarTheme","formatWeekday","useCallback","date","formatFlashCalendarWeekdayShort","activeRanges","useMemo","startId","endId","unavailableDateIds","getMonthDateIds","filter","isDateUnavailableRef","handleDayPress","dateId","toCalendarDateId","rules","getDateValidationReason","Calendar","calendarInstanceId","calendarMonthId","calendarActiveDateRanges","calendarMinDateId","calendarMaxDateId","calendarDisabledDateIds","calendarMonthHeaderHeight","calendarDayHeight","FLASH_CALENDAR_DAY_HEIGHT","calendarWeekHeaderHeight","calendarRowVerticalSpacing","calendarRowHorizontalSpacing","getCalendarMonthFormat","getCalendarWeekDayFormat","onCalendarDayPress","CalendarYearPickerGrid","exports","Object","assign","Header","Grid","YearPicker"],"sourceRoot":"../../../../src","sources":["components/Calendar/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,uBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AAAgD,IAAAS,WAAA,GAAAT,OAAA;AAOhD,SAASU,mBAAmBA,CAAA,EAAG;EAC7B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,8BAAkB,EAAC,CAAC;EACrC,oBACE,IAAAH,WAAA,CAAAI,IAAA,EAAAJ,WAAA,CAAAK,QAAA;IAAAC,QAAA,gBACE,IAAAN,WAAA,CAAAO,GAAA,EAACC,cAAc,IAAE,CAAC,EACjBN,IAAI,KAAK,MAAM,gBAAG,IAAAF,WAAA,CAAAO,GAAA,EAACE,kBAAkB,IAAE,CAAC,gBAAG,IAAAT,WAAA,CAAAO,GAAA,EAACG,Y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AAc;EACtBiF,IAAI,EAAE/E,YAAY;EAClBgF,UAAU,EAAEjF;AACd,CAAC,CAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorAreaPaint = ColorAreaPaint;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
10
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function ColorAreaPaint() {
|
|
14
|
+
const {
|
|
15
|
+
value,
|
|
16
|
+
isRTL
|
|
17
|
+
} = (0, _primitives.useColorAreaContext)();
|
|
18
|
+
const horizontalGradientId = (0, _react.useId)();
|
|
19
|
+
const verticalGradientId = (0, _react.useId)();
|
|
20
|
+
const hue = value.withChannel('hsb', 'saturation', 100).withChannel('hsb', 'brightness', 100);
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
22
|
+
className: (0, _styles.colorAreaPaintVariants)(),
|
|
23
|
+
style: styles.paint,
|
|
24
|
+
accessible: false,
|
|
25
|
+
accessibilityElementsHidden: true,
|
|
26
|
+
importantForAccessibility: "no-hide-descendants",
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Svg, {
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%",
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.Defs, {
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
|
|
32
|
+
id: horizontalGradientId,
|
|
33
|
+
x1: isRTL ? '100%' : '0%',
|
|
34
|
+
y1: "0%",
|
|
35
|
+
x2: isRTL ? '0%' : '100%',
|
|
36
|
+
y2: "0%",
|
|
37
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
38
|
+
offset: "0%",
|
|
39
|
+
stopColor: "#FFFFFF"
|
|
40
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
41
|
+
offset: "100%",
|
|
42
|
+
stopColor: hue.toString('hex')
|
|
43
|
+
})]
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, {
|
|
45
|
+
id: verticalGradientId,
|
|
46
|
+
x1: "0%",
|
|
47
|
+
y1: "0%",
|
|
48
|
+
x2: "0%",
|
|
49
|
+
y2: "100%",
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
51
|
+
offset: "0%",
|
|
52
|
+
stopColor: "#000000",
|
|
53
|
+
stopOpacity: 0
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, {
|
|
55
|
+
offset: "100%",
|
|
56
|
+
stopColor: "#000000",
|
|
57
|
+
stopOpacity: 1
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
|
|
61
|
+
width: "100%",
|
|
62
|
+
height: "100%",
|
|
63
|
+
fill: `url(#${horizontalGradientId})`
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, {
|
|
65
|
+
width: "100%",
|
|
66
|
+
height: "100%",
|
|
67
|
+
fill: `url(#${verticalGradientId})`
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
ColorAreaPaint.displayName = 'ColorAreaPaint';
|
|
73
|
+
const styles = _reactNative.StyleSheet.create({
|
|
74
|
+
paint: {
|
|
75
|
+
pointerEvents: 'none'
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=ColorAreaPaint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","_primitives","_styles","_jsxRuntime","ColorAreaPaint","value","isRTL","useColorAreaContext","horizontalGradientId","useId","verticalGradientId","hue","withChannel","jsx","View","className","colorAreaPaintVariants","style","styles","paint","accessible","accessibilityElementsHidden","importantForAccessibility","children","jsxs","Svg","width","height","Defs","LinearGradient","id","x1","y1","x2","y2","Stop","offset","stopColor","toString","stopOpacity","Rect","fill","displayName","StyleSheet","create","pointerEvents"],"sourceRoot":"../../../../src","sources":["components/ColorArea/ColorAreaPaint.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AAE3C,SAASM,cAAcA,CAAA,EAAG;EAC/B,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAG,IAAAC,+BAAmB,EAAC,CAAC;EAC9C,MAAMC,oBAAoB,GAAG,IAAAC,YAAK,EAAC,CAAC;EACpC,MAAMC,kBAAkB,GAAG,IAAAD,YAAK,EAAC,CAAC;EAClC,MAAME,GAAG,GAAGN,KAAK,CAACO,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CAACA,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC;EAE7F,oBACE,IAAAT,WAAA,CAAAU,GAAA,EAACd,YAAA,CAAAe,IAAI;IACHC,SAAS,EAAE,IAAAC,8BAAsB,EAAC,CAAE;IACpCC,KAAK,EAAEC,MAAM,CAACC,KAAM;IACpBC,UAAU,EAAE,KAAM;I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AM,EAAC,MAAM;YAACC,SAAS,EAAC,SAAS;YAACE,WAAW,EAAE;UAAE,CAAE,CAAC;QAAA,CAC5C,CAAC;MAAA,CACb,CAAC,eACP,IAAApC,WAAA,CAAAU,GAAA,EAACb,eAAA,CAAAwC,IAAI;QAACd,KAAK,EAAC,MAAM;QAACC,MAAM,EAAC,MAAM;QAACc,IAAI,EAAE,QAAQjC,oBAAoB;MAAI,CAAE,CAAC,eAC1E,IAAAL,WAAA,CAAAU,GAAA,EAACb,eAAA,CAAAwC,IAAI;QAACd,KAAK,EAAC,MAAM;QAACC,MAAM,EAAC,MAAM;QAACc,IAAI,EAAE,QAAQ/B,kBAAkB;MAAI,CAAE,CAAC;IAAA,CACrE;EAAC,CACF,CAAC;AAEX;AAEAN,cAAc,CAACsC,WAAW,GAAG,gBAAgB;AAE7C,MAAMxB,MAAM,GAAGyB,uBAAU,CAACC,MAAM,CAAC;EAC/BzB,KAAK,EAAE;IACL0B,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorAreaPaint = ColorAreaPaint;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _styles = require("./styles");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function ColorAreaPaint() {
|
|
12
|
+
const {
|
|
13
|
+
value,
|
|
14
|
+
isRTL
|
|
15
|
+
} = (0, _primitives.useColorAreaContext)();
|
|
16
|
+
const hue = value.withChannel('hsb', 'saturation', 100).withChannel('hsb', 'brightness', 100).toString('hex');
|
|
17
|
+
const direction = isRTL ? 'to left' : 'to right';
|
|
18
|
+
const paintStyle = {
|
|
19
|
+
backgroundImage: ['linear-gradient(to bottom, transparent, #000000)', `linear-gradient(${direction}, #FFFFFF, ${hue})`].join(', '),
|
|
20
|
+
pointerEvents: 'none'
|
|
21
|
+
};
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
23
|
+
className: (0, _styles.colorAreaPaintVariants)(),
|
|
24
|
+
style: paintStyle,
|
|
25
|
+
accessible: false,
|
|
26
|
+
accessibilityElementsHidden: true,
|
|
27
|
+
importantForAccessibility: "no-hide-descendants"
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
ColorAreaPaint.displayName = 'ColorAreaPaint';
|
|
31
|
+
//# sourceMappingURL=ColorAreaPaint.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_primitives","_styles","_jsxRuntime","ColorAreaPaint","value","isRTL","useColorAreaContext","hue","withChannel","toString","direction","paintStyle","backgroundImage","join","pointerEvents","jsx","View","className","colorAreaPaintVariants","style","accessible","accessibilityElementsHidden","importantForAccessibility","displayName"],"sourceRoot":"../../../../src","sources":["components/ColorArea/ColorAreaPaint.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAkD,IAAAG,WAAA,GAAAH,OAAA;AAE3C,SAASI,cAAcA,CAAA,EAAG;EAC/B,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAG,IAAAC,+BAAmB,EAAC,CAAC;EAC9C,MAAMC,GAAG,GAAGH,KAAK,CACdI,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CACrCA,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CACrCC,QAAQ,CAAC,KAAK,CAAC;EAClB,MAAMC,SAAS,GAAGL,KAAK,GAAG,SAAS,GAAG,UAAU;EAChD,MAAMM,UAAU,GAAG;IACjBC,eAAe,EAAE,CACf,kDAAkD,EAClD,mBAAmBF,SAAS,cAAcH,GAAG,GAAG,CACjD,CAACM,IAAI,CAAC,IAAI,CAAC;IACZC,aAAa,EAAE;EACjB,CAAyB;EAEzB,oBACE,IAAAZ,WAAA,CAAAa,GAAA,EAACjB,YAAA,CAAAkB,IAAI;IACHC,SAAS,EAAE,IAAAC,8BAAsB,EAAC,CAAE;IACpCC,KAAK,EAAER,UAAW;IAClBS,UAAU,EAAE,KAAM;IAClBC,2BAA2B;IAC3BC,yBAAyB,EAAC;EAAqB,CAChD,CAAC;AAEN;AAEAnB,cAAc,CAACoB,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorArea = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _ColorAreaPaint = require("./ColorAreaPaint");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const ColorAreaRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
14
|
+
asChild,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.ColorAreaRoot, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
asChild: asChild,
|
|
22
|
+
className: (0, _utils.cn)((0, _styles.colorAreaVariants)(), className),
|
|
23
|
+
style: style,
|
|
24
|
+
...props,
|
|
25
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
26
|
+
slot: 'color-area'
|
|
27
|
+
})),
|
|
28
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorAreaPaint.ColorAreaPaint, {}), children]
|
|
29
|
+
}));
|
|
30
|
+
ColorAreaRoot.displayName = 'ColorArea';
|
|
31
|
+
const ColorAreaThumb = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
32
|
+
className,
|
|
33
|
+
style,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}, ref) => {
|
|
37
|
+
const {
|
|
38
|
+
value
|
|
39
|
+
} = (0, _primitives.useColorAreaContext)();
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorAreaThumb, {
|
|
41
|
+
ref: ref,
|
|
42
|
+
className: (0, _utils.cn)((0, _styles.colorAreaThumbVariants)(), className),
|
|
43
|
+
style: [{
|
|
44
|
+
backgroundColor: value.toString('hex')
|
|
45
|
+
}, style],
|
|
46
|
+
...props,
|
|
47
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
48
|
+
slot: 'color-area-thumb'
|
|
49
|
+
})),
|
|
50
|
+
children: children
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
ColorAreaThumb.displayName = 'ColorArea.Thumb';
|
|
54
|
+
const ColorArea = exports.ColorArea = Object.assign(ColorAreaRoot, {
|
|
55
|
+
Thumb: ColorAreaThumb
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_primitives","_utils","_ColorAreaPaint","_styles","_jsxRuntime","ColorAreaRoot","forwardRef","asChild","className","style","children","props","ref","jsxs","cn","colorAreaVariants","mergeDataAttributes","dataAttributes","slot","jsx","ColorAreaPaint","displayName","ColorAreaThumb","value","useColorAreaContext","colorAreaThumbVariants","backgroundColor","toString","ColorArea","exports","Object","assign","Thumb"],"sourceRoot":"../../../../src","sources":["components/ColorArea/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA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AAK,CAACI,QAAQ,CAAC,KAAK;IAAE,CAAC,EAAElB,KAAK,CAAE;IAAA,GACvDE,KAAK;IAAA,GACL,IAAAK,+BAAmB,EAACL,KAAK,EAAE,IAAAM,0BAAc,EAAC;MAAEC,IAAI,EAAE;IAAmB,CAAC,CAAC,CAAC;IAAAR,QAAA,EAE3EA;EAAQ,CACc,CAAC;AAE9B,CACF,CAAC;AAEDY,cAAc,CAACD,WAAW,GAAG,iBAAiB;AAMvC,MAAMO,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,MAAM,CAACC,MAAM,CAAC1B,aAAa,EAAE;EACpD2B,KAAK,EAAEV;AACT,CAAC,CAA+B","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.colorAreaVariants = exports.colorAreaThumbVariants = exports.colorAreaPaintVariants = void 0;
|
|
7
|
+
var _utils = require("@cdx-ui/utils");
|
|
8
|
+
var _constants = require("../../styles/constants");
|
|
9
|
+
const colorAreaVariants = exports.colorAreaVariants = (0, _utils.cva)(['relative aspect-square w-full touch-none select-none', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', _constants.DISABLED_CURSOR]);
|
|
10
|
+
const colorAreaPaintVariants = exports.colorAreaPaintVariants = (0, _utils.cva)(['absolute inset-0 overflow-hidden rounded-[var(--border-radius-default)]']);
|
|
11
|
+
const colorAreaThumbVariants = exports.colorAreaThumbVariants = (0, _utils.cva)(['z-2 size-5 rounded-[var(--border-radius-round)]', 'border-2 border-surface-primary shadow-md', 'transition-none']);
|
|
12
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","_constants","colorAreaVariants","exports","cva","DISABLED_CURSOR","colorAreaPaintVariants","colorAreaThumbVariants"],"sourceRoot":"../../../../src","sources":["components/ColorArea/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,UAAG,EAAC,CACnC,sDAAsD,EACtD,wDAAwD,EACxDC,0BAAe,CAChB,CAAC;AAEK,MAAMC,sBAAsB,GAAAH,OAAA,CAAAG,sBAAA,GAAG,IAAAF,UAAG,EAAC,CACxC,yEAAyE,CAC1E,CAAC;AAEK,MAAMG,sBAAsB,GAAAJ,OAAA,CAAAI,sBAAA,GAAG,IAAAH,UAAG,EAAC,CACxC,iDAAiD,EACjD,2CAA2C,EAC3C,iBAAiB,CAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorField = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
10
|
+
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _positionToDataIcon = require("../../utils/positionToDataIcon");
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const SCOPE = 'COLOR_FIELD';
|
|
15
|
+
const useColorFieldStyleContext = () => (0, _utils.useParentContext)()[SCOPE] ?? {};
|
|
16
|
+
const ColorFieldRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
17
|
+
variant = 'outline',
|
|
18
|
+
size = 'default',
|
|
19
|
+
fullWidth,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
style,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => {
|
|
25
|
+
const parent = (0, _utils.useParentContext)();
|
|
26
|
+
const context = (0, _react.useMemo)(() => ({
|
|
27
|
+
...parent,
|
|
28
|
+
[SCOPE]: {
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
fullWidth
|
|
32
|
+
}
|
|
33
|
+
}), [fullWidth, parent, size, variant]);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
35
|
+
value: context,
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorFieldRoot, {
|
|
37
|
+
ref: ref,
|
|
38
|
+
className: (0, _utils.cn)((0, _styles.colorFieldVariants)(), className),
|
|
39
|
+
style: style,
|
|
40
|
+
...props,
|
|
41
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
42
|
+
slot: 'color-field'
|
|
43
|
+
})),
|
|
44
|
+
children: children
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
ColorFieldRoot.displayName = 'ColorField';
|
|
49
|
+
const ColorFieldGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
50
|
+
asChild,
|
|
51
|
+
variant,
|
|
52
|
+
size,
|
|
53
|
+
fullWidth,
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
style,
|
|
57
|
+
...props
|
|
58
|
+
}, ref) => {
|
|
59
|
+
const inherited = useColorFieldStyleContext();
|
|
60
|
+
const {
|
|
61
|
+
disabled,
|
|
62
|
+
invalid,
|
|
63
|
+
readOnly,
|
|
64
|
+
required
|
|
65
|
+
} = (0, _primitives.useColorFieldContext)();
|
|
66
|
+
const resolvedVariant = variant ?? inherited.variant ?? 'outline';
|
|
67
|
+
const resolvedSize = size ?? inherited.size ?? 'default';
|
|
68
|
+
const resolvedFullWidth = fullWidth ?? inherited.fullWidth ?? true;
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.InputRoot, {
|
|
70
|
+
ref: ref,
|
|
71
|
+
asChild: asChild,
|
|
72
|
+
isDisabled: disabled,
|
|
73
|
+
isInvalid: invalid,
|
|
74
|
+
isReadOnly: readOnly,
|
|
75
|
+
isRequired: required,
|
|
76
|
+
className: (0, _utils.cn)((0, _styles.colorFieldGroupVariants)({
|
|
77
|
+
variant: resolvedVariant,
|
|
78
|
+
size: resolvedSize
|
|
79
|
+
}), !resolvedFullWidth && 'w-auto self-start', className),
|
|
80
|
+
style: style,
|
|
81
|
+
...props,
|
|
82
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
83
|
+
slot: 'color-field-group'
|
|
84
|
+
})),
|
|
85
|
+
children: children
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
ColorFieldGroup.displayName = 'ColorField.Group';
|
|
89
|
+
const ColorFieldInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
90
|
+
className,
|
|
91
|
+
placeholderTextColorClassName,
|
|
92
|
+
style,
|
|
93
|
+
...props
|
|
94
|
+
}, ref) => {
|
|
95
|
+
const {
|
|
96
|
+
size
|
|
97
|
+
} = useColorFieldStyleContext();
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ColorFieldInput, {
|
|
99
|
+
ref: ref,
|
|
100
|
+
className: (0, _utils.cn)((0, _styles.colorFieldInputVariants)({
|
|
101
|
+
size: size ?? 'default'
|
|
102
|
+
}), className),
|
|
103
|
+
placeholderTextColorClassName: (0, _utils.cn)((0, _styles.colorFieldInputPlaceholderVariants)(), placeholderTextColorClassName),
|
|
104
|
+
style: style,
|
|
105
|
+
...props,
|
|
106
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
107
|
+
slot: 'color-field-input'
|
|
108
|
+
}))
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
ColorFieldInput.displayName = 'ColorField.Input';
|
|
112
|
+
const ColorFieldSlot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
113
|
+
asChild,
|
|
114
|
+
position,
|
|
115
|
+
className,
|
|
116
|
+
children,
|
|
117
|
+
style,
|
|
118
|
+
...props
|
|
119
|
+
}, ref) => {
|
|
120
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
121
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
122
|
+
ref: ref,
|
|
123
|
+
className: (0, _utils.cn)((0, _styles.colorFieldSlotVariants)(), className),
|
|
124
|
+
style: style,
|
|
125
|
+
...props,
|
|
126
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
127
|
+
slot: 'color-field-slot'
|
|
128
|
+
}), (0, _positionToDataIcon.positionToDataIcon)(position)),
|
|
129
|
+
children: children
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
ColorFieldSlot.displayName = 'ColorField.Slot';
|
|
133
|
+
const ColorField = exports.ColorField = Object.assign(ColorFieldRoot, {
|
|
134
|
+
Group: ColorFieldGroup,
|
|
135
|
+
Input: ColorFieldInput,
|
|
136
|
+
Slot: ColorFieldSlot
|
|
137
|
+
});
|
|
138
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_positionToDataIcon","_styles","_jsxRuntime","SCOPE","useColorFieldStyleContext","useParentContext","ColorFieldRoot","forwardRef","variant","size","fullWidth","className","children","style","props","ref","parent","context","useMemo","jsx","ParentContext","Provider","value","cn","colorFieldVariants","mergeDataAttributes","dataAttributes","slot","displayName","ColorFieldGroup","asChild","inherited","disabled","invalid","readOnly","required","useColorFieldContext","resolvedVariant","resolvedSize","resolvedFullWidth","InputRoot","isDisabled","isInvalid","isReadOnly","isRequired","colorFieldGroupVariants","ColorFieldInput","placeholderTextColorClassName","colorFieldInputVariants","colorFieldInputPlaceholderVariants","ColorFieldSlot","position","Comp","Slot","View","colorFieldSlotVariants","positionToDataIcon","ColorField","exports","Object","assign","Group","Input"],"sourceRoot":"../../../../src","sources":["components/ColorField/index.t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IACHrC,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAE,IAAAY,SAAE,EAAC,IAAAgC,8BAAsB,EAAC,CAAC,EAAE5C,SAAS,CAAE;IACnDE,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAA,GACL,IAAAW,+BAAmB,EACrBX,KAAK,EACL,IAAAY,0BAAc,EAAC;MAAEC,IAAI,EAAE;IAAmB,CAAC,CAAC,EAC5C,IAAA6B,sCAAkB,EAACL,QAAQ,CAC7B,CAAC;IAAAvC,QAAA,EAEAA;EAAQ,CACL,CAAC;AAEX,CACF,CAAC;AAEDsC,cAAc,CAACtB,WAAW,GAAG,iBAAiB;AAQvC,MAAM6B,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAGE,MAAM,CAACC,MAAM,CAACtD,cAAc,EAAE;EACtDuD,KAAK,EAAEhC,eAAe;EACtBiC,KAAK,EAAEhB,eAAe;EACtBO,IAAI,EAAEH;AACR,CAAC,CAAgC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.colorFieldVariants = exports.colorFieldSlotVariants = exports.colorFieldInputVariants = exports.colorFieldInputPlaceholderVariants = exports.colorFieldGroupVariants = void 0;
|
|
7
|
+
var _utils = require("@cdx-ui/utils");
|
|
8
|
+
var _styles = require("../Input/styles");
|
|
9
|
+
const colorFieldVariants = exports.colorFieldVariants = (0, _utils.cva)('gap-1.5');
|
|
10
|
+
const colorFieldGroupVariants = exports.colorFieldGroupVariants = _styles.inputRootVariants;
|
|
11
|
+
const colorFieldInputVariants = exports.colorFieldInputVariants = _styles.inputFieldVariants;
|
|
12
|
+
const colorFieldInputPlaceholderVariants = exports.colorFieldInputPlaceholderVariants = _styles.inputFieldPlaceholderVariants;
|
|
13
|
+
const colorFieldSlotVariants = exports.colorFieldSlotVariants = _styles.inputSlotVariants;
|
|
14
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","_styles","colorFieldVariants","exports","cva","colorFieldGroupVariants","inputRootVariants","colorFieldInputVariants","inputFieldVariants","colorFieldInputPlaceholderVariants","inputFieldPlaceholderVariants","colorFieldSlotVariants","inputSlotVariants"],"sourceRoot":"../../../../src","sources":["components/ColorField/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,UAAG,EAAC,SAAS,CAAC;AAEzC,MAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAGC,yBAAiB;AAEjD,MAAMC,uBAAuB,GAAAJ,OAAA,CAAAI,uBAAA,GAAGC,0BAAkB;AAElD,MAAMC,kCAAkC,GAAAN,OAAA,CAAAM,kCAAA,GAAGC,qCAA6B;AAExE,MAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAGC,yBAAiB","ignoreList":[]}
|