@wordpress/components 30.8.1-next.16d95556a.0 → 30.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/build/date-time/date/index.js +5 -5
- package/build/date-time/date/index.js.map +2 -2
- package/build/date-time/utils.js +3 -1
- package/build/date-time/utils.js.map +2 -2
- package/build/external-link/index.js +1 -1
- package/build/external-link/index.js.map +2 -2
- package/build-module/date-time/date/index.js +6 -6
- package/build-module/date-time/date/index.js.map +2 -2
- package/build-module/date-time/utils.js +3 -1
- package/build-module/date-time/utils.js.map +2 -2
- package/build-module/external-link/index.js +2 -2
- package/build-module/external-link/index.js.map +2 -2
- package/build-style/style-rtl.css +8 -3
- package/build-style/style.css +8 -3
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/test/index.d.ts +2 -0
- package/build-types/date-time/date-time/test/index.d.ts.map +1 -0
- package/build-types/date-time/test/utils.test.d.ts +2 -0
- package/build-types/date-time/test/utils.test.d.ts.map +1 -0
- package/build-types/date-time/utils.d.ts +3 -2
- package/build-types/date-time/utils.d.ts.map +1 -1
- package/build-types/draggable/stories/index.story.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/stories/index.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/package.json +24 -20
- package/src/alignment-matrix-control/stories/index.story.tsx +4 -1
- package/src/angle-picker-control/stories/index.story.tsx +4 -1
- package/src/box-control/stories/index.story.tsx +4 -1
- package/src/circular-option-picker/stories/index.story.tsx +0 -1
- package/src/color-picker/stories/index.story.tsx +4 -1
- package/src/combobox-control/stories/index.story.tsx +5 -1
- package/src/confirm-dialog/stories/index.story.tsx +5 -1
- package/src/custom-gradient-picker/stories/index.story.tsx +4 -1
- package/src/custom-select-control/stories/index.story.tsx +4 -1
- package/src/custom-select-control-v2/stories/index.story.tsx +0 -1
- package/src/date-time/date/index.tsx +6 -16
- package/src/date-time/date-time/test/index.tsx +206 -0
- package/src/date-time/test/utils.test.ts +128 -0
- package/src/date-time/utils.ts +12 -3
- package/src/draggable/stories/index.story.tsx +6 -1
- package/src/drop-zone/stories/index.story.tsx +6 -1
- package/src/dropdown/stories/index.story.tsx +5 -1
- package/src/dropdown-menu/stories/index.story.tsx +4 -1
- package/src/external-link/index.tsx +2 -2
- package/src/focal-point-picker/stories/index.story.tsx +7 -1
- package/src/font-size-picker/stories/index.story.tsx +4 -1
- package/src/gradient-picker/stories/index.story.tsx +5 -1
- package/src/guide/style.scss +0 -6
- package/src/input-control/stories/index.story.tsx +7 -1
- package/src/menu/stories/index.story.tsx +4 -1
- package/src/modal/style.scss +14 -0
- package/src/navigable-container/stories/navigable-menu.story.tsx +5 -1
- package/src/navigable-container/stories/tabbable-container.story.tsx +5 -1
- package/src/navigation/stories/index.story.tsx +4 -1
- package/src/notice/stories/index.story.tsx +5 -1
- package/src/palette-edit/stories/index.story.tsx +4 -1
- package/src/query-controls/stories/index.story.tsx +8 -1
- package/src/radio-group/stories/index.story.tsx +4 -1
- package/src/range-control/stories/index.story.tsx +8 -1
- package/src/sandbox/stories/index.story.tsx +4 -1
- package/src/select-control/stories/index.story.tsx +4 -1
- package/src/tab-panel/stories/index.story.tsx +0 -1
- package/src/tabs/stories/index.story.tsx +0 -1
- package/src/text/stories/index.story.tsx +0 -1
- package/src/tools-panel/stories/index.story.tsx +4 -1
- package/src/tree-grid/stories/index.story.tsx +6 -1
- package/src/unit-control/stories/index.story.tsx +7 -1
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- /package/src/context/stories/{ComponentsProvider.stories.js → ComponentsProvider.stories.jsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 30.9.0 (2025-11-26)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- `ExternalLink`: Fix arrow direction for RTL languages. The external link arrow now correctly points to the top-left (↖) instead of top-right (↗) in RTL layouts. ([#73400](https://github.com/WordPress/gutenberg/pull/73400))
|
|
10
|
+
- Fixed an issue where the `Guide` component’s close button became invisible on hover when used on light backgrounds. The component's close button now relies on the default button hover effect, and the custom hover color is applied only within `welcome-guide` implementations to maintain consistency. ([#73220](https://github.com/WordPress/gutenberg/pull/73220))
|
|
11
|
+
- `DateTimePicker`: Fixed timezone handling when selecting specific dates around changes in daylight savings time when browser and server timezone settings are not in sync, which would cause an incorrect date to be selected. ([#73444](https://github.com/WordPress/gutenberg/pull/73444))
|
|
12
|
+
|
|
5
13
|
## 30.8.0 (2025-11-12)
|
|
6
14
|
|
|
7
15
|
### Bug Fixes
|
|
@@ -11,6 +19,8 @@
|
|
|
11
19
|
- `Card`, `CardHeader`, `CardBody` and `CardFooter`: Add support for directional padding through object-based size prop, allowing independent control of padding for each side ([#72511](https://github.com/WordPress/gutenberg/pull/72511)).
|
|
12
20
|
- `CustomSelectControl`: Fix the options with the same name are shown as the selected option ([#72189](https://github.com/WordPress/gutenberg/pull/72189)).
|
|
13
21
|
- `NumberControl`: Fix crash when min prop is string and step prop contains decimal ([#73107](https://github.com/WordPress/gutenberg/pull/73107)).
|
|
22
|
+
- `Modal`: Fix full-screen modal height to allow contents to scroll properly ([#73150](https://github.com/WordPress/gutenberg/pull/73150)).
|
|
23
|
+
|
|
14
24
|
|
|
15
25
|
### Internal
|
|
16
26
|
|
|
@@ -83,8 +83,8 @@ function DatePicker({
|
|
|
83
83
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.NavigatorHeading, {
|
|
84
84
|
level: 3,
|
|
85
85
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", {
|
|
86
|
-
children: (0, import_date.
|
|
87
|
-
}), " ", (0, import_date.
|
|
86
|
+
children: (0, import_date.gmdateI18n)("F", viewing)
|
|
87
|
+
}), " ", (0, import_date.gmdateI18n)("Y", viewing)]
|
|
88
88
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.ViewNextMonthButton, {
|
|
89
89
|
icon: (0, import_i18n.isRTL)() ? import_icons.arrowLeft : import_icons.arrowRight,
|
|
90
90
|
variant: "tertiary",
|
|
@@ -100,7 +100,7 @@ function DatePicker({
|
|
|
100
100
|
onFocus: () => setIsFocusWithinCalendar(true),
|
|
101
101
|
onBlur: () => setIsFocusWithinCalendar(false),
|
|
102
102
|
children: [calendar[0][0].map((day) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.DayOfWeek, {
|
|
103
|
-
children: (0, import_date.
|
|
103
|
+
children: (0, import_date.gmdateI18n)("D", day)
|
|
104
104
|
}, day.toString())), calendar[0].map((week) => week.map((day, index) => {
|
|
105
105
|
if (!(0, import_date_fns.isSameMonth)(day, viewing)) {
|
|
106
106
|
return null;
|
|
@@ -194,14 +194,14 @@ function Day({
|
|
|
194
194
|
hasEvents: numEvents > 0,
|
|
195
195
|
onClick,
|
|
196
196
|
onKeyDown,
|
|
197
|
-
children: (0, import_date.
|
|
197
|
+
children: (0, import_date.gmdateI18n)("j", day)
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
function getDayLabel(date, isSelected, numEvents) {
|
|
201
201
|
const {
|
|
202
202
|
formats
|
|
203
203
|
} = (0, import_date.getSettings)();
|
|
204
|
-
const localizedDate = (0, import_date.
|
|
204
|
+
const localizedDate = (0, import_date.gmdateI18n)(formats.date, date);
|
|
205
205
|
if (isSelected && numEvents > 0) {
|
|
206
206
|
return (0, import_i18n.sprintf)(
|
|
207
207
|
// translators: 1: The calendar date. 2: Number of events on the calendar date.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/date-time/date/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { format, isSameDay, subMonths, addMonths, startOfDay, isEqual, addDays, subWeeks, addWeeks, isSameMonth, startOfWeek, endOfWeek } from 'date-fns';\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAA+I;AAI/I,kBAAuC;AACvC,mBAAsC;AACtC,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { format, isSameDay, subMonths, addMonths, startOfDay, isEqual, addDays, subWeeks, addWeeks, isSameMonth, startOfWeek, endOfWeek } from 'date-fns';\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport { getSettings, gmdateI18n } from '@wordpress/date';\nimport { useState, useRef, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLilius } from './use-lilius';\nimport { Wrapper, Navigator, ViewPreviousMonthButton, ViewNextMonthButton, NavigatorHeading, Calendar, DayOfWeek, DayButton } from './styles';\nimport { inputToDate } from '../utils';\nimport { TIMEZONELESS_FORMAT } from '../constants';\n\n/**\n * DatePicker is a React component that renders a calendar for date selection.\n *\n * ```jsx\n * import { DatePicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDatePicker = () => {\n * const [ date, setDate ] = useState( new Date() );\n *\n * return (\n * <DatePicker\n * currentDate={ date }\n * onChange={ ( newDate ) => setDate( newDate ) }\n * />\n * );\n * };\n * ```\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function DatePicker({\n currentDate,\n onChange,\n events = [],\n isInvalidDate,\n onMonthPreviewed,\n startOfWeek: weekStartsOn = 0\n}) {\n const date = currentDate ? inputToDate(currentDate) : new Date();\n const {\n calendar,\n viewing,\n setSelected,\n setViewing,\n isSelected,\n viewPreviousMonth,\n viewNextMonth\n } = useLilius({\n selected: [startOfDay(date)],\n viewing: startOfDay(date),\n weekStartsOn\n });\n\n // Used to implement a roving tab index. Tracks the day that receives focus\n // when the user tabs into the calendar.\n const [focusable, setFocusable] = useState(startOfDay(date));\n\n // Allows us to only programmatically focus() a day when focus was already\n // within the calendar. This stops us stealing focus from e.g. a TimePicker\n // input.\n const [isFocusWithinCalendar, setIsFocusWithinCalendar] = useState(false);\n\n // Update internal state when currentDate prop changes.\n const [prevCurrentDate, setPrevCurrentDate] = useState(currentDate);\n if (currentDate !== prevCurrentDate) {\n setPrevCurrentDate(currentDate);\n setSelected([startOfDay(date)]);\n setViewing(startOfDay(date));\n setFocusable(startOfDay(date));\n }\n return /*#__PURE__*/_jsxs(Wrapper, {\n className: \"components-datetime__date\",\n role: \"application\",\n \"aria-label\": __('Calendar'),\n children: [/*#__PURE__*/_jsxs(Navigator, {\n children: [/*#__PURE__*/_jsx(ViewPreviousMonthButton, {\n icon: isRTL() ? arrowRight : arrowLeft,\n variant: \"tertiary\",\n \"aria-label\": __('View previous month'),\n onClick: () => {\n viewPreviousMonth();\n setFocusable(subMonths(focusable, 1));\n onMonthPreviewed?.(format(subMonths(viewing, 1), TIMEZONELESS_FORMAT));\n },\n size: \"compact\"\n }), /*#__PURE__*/_jsxs(NavigatorHeading, {\n level: 3,\n children: [/*#__PURE__*/_jsx(\"strong\", {\n children: gmdateI18n('F', viewing)\n }), ' ', gmdateI18n('Y', viewing)]\n }), /*#__PURE__*/_jsx(ViewNextMonthButton, {\n icon: isRTL() ? arrowLeft : arrowRight,\n variant: \"tertiary\",\n \"aria-label\": __('View next month'),\n onClick: () => {\n viewNextMonth();\n setFocusable(addMonths(focusable, 1));\n onMonthPreviewed?.(format(addMonths(viewing, 1), TIMEZONELESS_FORMAT));\n },\n size: \"compact\"\n })]\n }), /*#__PURE__*/_jsxs(Calendar, {\n onFocus: () => setIsFocusWithinCalendar(true),\n onBlur: () => setIsFocusWithinCalendar(false),\n children: [calendar[0][0].map(day => /*#__PURE__*/_jsx(DayOfWeek, {\n children: gmdateI18n('D', day)\n }, day.toString())), calendar[0].map(week => week.map((day, index) => {\n if (!isSameMonth(day, viewing)) {\n return null;\n }\n return /*#__PURE__*/_jsx(Day, {\n day: day,\n column: index + 1,\n isSelected: isSelected(day),\n isFocusable: isEqual(day, focusable),\n isFocusAllowed: isFocusWithinCalendar,\n isToday: isSameDay(day, new Date()),\n isInvalid: isInvalidDate ? isInvalidDate(day) : false,\n numEvents: events.filter(event => isSameDay(event.date, day)).length,\n onClick: () => {\n setSelected([day]);\n setFocusable(day);\n onChange?.(format(\n // Don't change the selected date's time fields.\n new Date(day.getFullYear(), day.getMonth(), day.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()), TIMEZONELESS_FORMAT));\n },\n onKeyDown: event => {\n let nextFocusable;\n if (event.key === 'ArrowLeft') {\n nextFocusable = addDays(day, isRTL() ? 1 : -1);\n }\n if (event.key === 'ArrowRight') {\n nextFocusable = addDays(day, isRTL() ? -1 : 1);\n }\n if (event.key === 'ArrowUp') {\n nextFocusable = subWeeks(day, 1);\n }\n if (event.key === 'ArrowDown') {\n nextFocusable = addWeeks(day, 1);\n }\n if (event.key === 'PageUp') {\n nextFocusable = subMonths(day, 1);\n }\n if (event.key === 'PageDown') {\n nextFocusable = addMonths(day, 1);\n }\n if (event.key === 'Home') {\n nextFocusable = startOfWeek(day);\n }\n if (event.key === 'End') {\n nextFocusable = startOfDay(endOfWeek(day));\n }\n if (nextFocusable) {\n event.preventDefault();\n setFocusable(nextFocusable);\n if (!isSameMonth(nextFocusable, viewing)) {\n setViewing(nextFocusable);\n onMonthPreviewed?.(format(nextFocusable, TIMEZONELESS_FORMAT));\n }\n }\n }\n }, day.toString());\n }))]\n })]\n });\n}\nfunction Day({\n day,\n column,\n isSelected,\n isFocusable,\n isFocusAllowed,\n isToday,\n isInvalid,\n numEvents,\n onClick,\n onKeyDown\n}) {\n const ref = useRef();\n\n // Focus the day when it becomes focusable, e.g. because an arrow key is\n // pressed. Only do this if focus is allowed - this stops us stealing focus\n // from e.g. a TimePicker input.\n useEffect(() => {\n if (ref.current && isFocusable && isFocusAllowed) {\n ref.current.focus();\n }\n // isFocusAllowed is not a dep as there is no point calling focus() on\n // an already focused element.\n }, [isFocusable]);\n return /*#__PURE__*/_jsx(DayButton, {\n __next40pxDefaultSize: true,\n ref: ref,\n className: \"components-datetime__date__day\" // Unused, for backwards compatibility.\n ,\n disabled: isInvalid,\n tabIndex: isFocusable ? 0 : -1,\n \"aria-label\": getDayLabel(day, isSelected, numEvents),\n column: column,\n isSelected: isSelected,\n isToday: isToday,\n hasEvents: numEvents > 0,\n onClick: onClick,\n onKeyDown: onKeyDown,\n children: gmdateI18n('j', day)\n });\n}\nfunction getDayLabel(date, isSelected, numEvents) {\n const {\n formats\n } = getSettings();\n const localizedDate = gmdateI18n(formats.date, date);\n if (isSelected && numEvents > 0) {\n return sprintf(\n // translators: 1: The calendar date. 2: Number of events on the calendar date.\n _n('%1$s. Selected. There is %2$d event', '%1$s. Selected. There are %2$d events', numEvents), localizedDate, numEvents);\n } else if (isSelected) {\n return sprintf(\n // translators: 1: The calendar date.\n __('%1$s. Selected'), localizedDate);\n } else if (numEvents > 0) {\n return sprintf(\n // translators: 1: The calendar date. 2: Number of events on the calendar date.\n _n('%1$s. There is %2$d event', '%1$s. There are %2$d events', numEvents), localizedDate, numEvents);\n }\n return localizedDate;\n}\nexport default DatePicker;"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAA+I;AAI/I,kBAAuC;AACvC,mBAAsC;AACtC,kBAAwC;AACxC,qBAA4C;AAK5C,wBAA0B;AAC1B,oBAAmI;AACnI,mBAA4B;AAC5B,uBAAoC;AAqBpC,yBAA2C;AACpC,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA,SAAS,CAAC;AAAA,EACV;AAAA,EACA;AAAA,EAC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 __export(utils_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(utils_exports);
|
|
30
30
|
var import_date_fns = require("date-fns");
|
|
31
|
+
var import_utc = require("@date-fns/utc");
|
|
31
32
|
var import_actions = require("../input-control/reducer/actions");
|
|
32
33
|
function inputToDate(input) {
|
|
33
34
|
if (typeof input === "string") {
|
|
34
|
-
|
|
35
|
+
const hasTimezone = /Z|[+-]\d{2}(:?\d{2})?$/.test(input);
|
|
36
|
+
return hasTimezone ? new Date(input) : new import_utc.UTCDateMini(input + "Z");
|
|
35
37
|
}
|
|
36
38
|
return (0, import_date_fns.toDate)(input);
|
|
37
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/date-time/utils.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { toDate } from 'date-fns';\n\n/**\n * Internal dependencies\n */\n\nimport { COMMIT, PRESS_DOWN, PRESS_UP } from '../input-control/reducer/actions';\n\n/**\n * Like date-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuB;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { toDate } from 'date-fns';\nimport { UTCDateMini } from '@date-fns/utc';\n\n/**\n * Internal dependencies\n */\n\nimport { COMMIT, PRESS_DOWN, PRESS_UP } from '../input-control/reducer/actions';\n\n/**\n * Like date-fns's toDate, but tries to guess the format when a string is\n * given. For timezoneless strings, parse it as UTC using `@date-fns/utc` to\n * ensure calendar dates remain consistent across different browser timezones.\n *\n * @param input Value to turn into a date.\n */\nexport function inputToDate(input) {\n if (typeof input === 'string') {\n // Strings without timezone indicators are parsed as UTC to prevent day-\n // shift bugs across browser timezones. Note that JavaScript doesn't\n // fully support ISO-8601 time strings, so the behavior of passing these\n // through to the Date constructor is non-deterministic.\n //\n // See: https://tc39.es/ecma262/#sec-date-time-string-format\n const hasTimezone = /Z|[+-]\\d{2}(:?\\d{2})?$/.test(input);\n return hasTimezone ? new Date(input) : new UTCDateMini(input + 'Z');\n }\n return toDate(input);\n}\n\n/**\n * Converts a 12-hour time to a 24-hour time.\n * @param hours\n * @param isPm\n */\nexport function from12hTo24h(hours, isPm) {\n return isPm ? (hours % 12 + 12) % 24 : hours % 12;\n}\n\n/**\n * Converts a 24-hour time to a 12-hour time.\n * @param hours\n */\nexport function from24hTo12h(hours) {\n return hours % 12 || 12;\n}\n\n/**\n * Creates an InputControl reducer used to pad an input so that it is always a\n * given width. For example, the hours and minutes inputs are padded to 2 so\n * that '4' appears as '04'.\n *\n * @param pad How many digits the value should be.\n */\nexport function buildPadInputStateReducer(pad) {\n return (state, action) => {\n const nextState = {\n ...state\n };\n if (action.type === COMMIT || action.type === PRESS_UP || action.type === PRESS_DOWN) {\n if (nextState.value !== undefined) {\n nextState.value = nextState.value.toString().padStart(pad, '0');\n }\n }\n return nextState;\n };\n}\n\n/**\n * Validates the target of a React event to ensure it is an input element and\n * that the input is valid.\n * @param event\n */\nexport function validateInputElementTarget(event) {\n var _ownerDocument$defaul;\n // `instanceof` checks need to get the instance definition from the\n // corresponding window object \u2014 therefore, the following logic makes\n // the component work correctly even when rendered inside an iframe.\n const HTMLInputElementInstance = (_ownerDocument$defaul = event.target?.ownerDocument.defaultView?.HTMLInputElement) !== null && _ownerDocument$defaul !== void 0 ? _ownerDocument$defaul : HTMLInputElement;\n if (!(event.target instanceof HTMLInputElementInstance)) {\n return false;\n }\n return event.target.validity.valid;\n}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuB;AACvB,iBAA4B;AAM5B,qBAA6C;AAStC,SAAS,YAAY,OAAO;AACjC,MAAI,OAAO,UAAU,UAAU;AAO7B,UAAM,cAAc,yBAAyB,KAAK,KAAK;AACvD,WAAO,cAAc,IAAI,KAAK,KAAK,IAAI,IAAI,uBAAY,QAAQ,GAAG;AAAA,EACpE;AACA,aAAO,wBAAO,KAAK;AACrB;AAOO,SAAS,aAAa,OAAO,MAAM;AACxC,SAAO,QAAQ,QAAQ,KAAK,MAAM,KAAK,QAAQ;AACjD;AAMO,SAAS,aAAa,OAAO;AAClC,SAAO,QAAQ,MAAM;AACvB;AASO,SAAS,0BAA0B,KAAK;AAC7C,SAAO,CAAC,OAAO,WAAW;AACxB,UAAM,YAAY;AAAA,MAChB,GAAG;AAAA,IACL;AACA,QAAI,OAAO,SAAS,yBAAU,OAAO,SAAS,2BAAY,OAAO,SAAS,2BAAY;AACpF,UAAI,UAAU,UAAU,QAAW;AACjC,kBAAU,QAAQ,UAAU,MAAM,SAAS,EAAE,SAAS,KAAK,GAAG;AAAA,MAChE;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;AAOO,SAAS,2BAA2B,OAAO;AAChD,MAAI;AAIJ,QAAM,4BAA4B,wBAAwB,MAAM,QAAQ,cAAc,aAAa,sBAAsB,QAAQ,0BAA0B,SAAS,wBAAwB;AAC5L,MAAI,EAAE,MAAM,kBAAkB,2BAA2B;AACvD,WAAO;AAAA,EACT;AACA,SAAO,MAAM,OAAO,SAAS;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/external-link/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedExternalLink(props, ref) {\n const {\n href,\n children,\n className,\n rel = '',\n ...additionalProps\n } = props;\n const optimizedRel = [...new Set([...rel.split(' '), 'external', 'noreferrer', 'noopener'].filter(Boolean))].join(' ');\n const classes = clsx('components-external-link', className);\n /* Anchor links are perceived as external links.\n This constant helps check for on page anchor links,\n to prevent them from being opened in the editor. */\n const isInternalAnchor = !!href?.startsWith('#');\n const onClickHandler = event => {\n if (isInternalAnchor) {\n event.preventDefault();\n }\n if (props.onClick) {\n props.onClick(event);\n }\n };\n return /*#__PURE__*/ /* eslint-disable react/jsx-no-target-blank */_jsxs(\"a\", {\n ...additionalProps,\n className: classes,\n href: href,\n onClick: onClickHandler,\n target: \"_blank\",\n rel: optimizedRel,\n ref: ref,\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__contents\",\n children: children\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__icon\",\n \"aria-label\": /* translators: accessibility text */\n __('(opens in a new tab)'),\n children:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedExternalLink(props, ref) {\n const {\n href,\n children,\n className,\n rel = '',\n ...additionalProps\n } = props;\n const optimizedRel = [...new Set([...rel.split(' '), 'external', 'noreferrer', 'noopener'].filter(Boolean))].join(' ');\n const classes = clsx('components-external-link', className);\n /* Anchor links are perceived as external links.\n This constant helps check for on page anchor links,\n to prevent them from being opened in the editor. */\n const isInternalAnchor = !!href?.startsWith('#');\n const onClickHandler = event => {\n if (isInternalAnchor) {\n event.preventDefault();\n }\n if (props.onClick) {\n props.onClick(event);\n }\n };\n return /*#__PURE__*/ /* eslint-disable react/jsx-no-target-blank */_jsxs(\"a\", {\n ...additionalProps,\n className: classes,\n href: href,\n onClick: onClickHandler,\n target: \"_blank\",\n rel: optimizedRel,\n ref: ref,\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__contents\",\n children: children\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__icon\",\n \"aria-label\": /* translators: accessibility text */\n __('(opens in a new tab)'),\n children: isRTL() ? '\\u2196' : '\\u2197'\n })]\n })\n /* eslint-enable react/jsx-no-target-blank */;\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef(UnforwardedExternalLink);\nexport default ExternalLink;"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,kBAA0B;AAC1B,qBAA2B;AAK3B,yBAA2C;AAC3C,SAAS,wBAAwB,OAAO,KAAK;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,eAAe,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,MAAM,GAAG,GAAG,YAAY,cAAc,UAAU,EAAE,OAAO,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG;AACrH,QAAM,cAAU,YAAAA,SAAK,4BAA4B,SAAS;AAI1D,QAAM,mBAAmB,CAAC,CAAC,MAAM,WAAW,GAAG;AAC/C,QAAM,iBAAiB,WAAS;AAC9B,QAAI,kBAAkB;AACpB,YAAM,eAAe;AAAA,IACvB;AACA,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,KAAK;AAAA,IACrB;AAAA,EACF;AACA;AAAA;AAAA,IAAmE,uCAAAC,MAAM,KAAK;AAAA,MAC5E,GAAG;AAAA,MACH,WAAW;AAAA,MACX;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,KAAK;AAAA,MACL;AAAA,MACA,UAAU,CAAc,uCAAAC,KAAK,QAAQ;AAAA,QACnC,WAAW;AAAA,QACX;AAAA,MACF,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,QAC5B,WAAW;AAAA,QACX;AAAA;AAAA,cACA,gBAAG,sBAAsB;AAAA;AAAA,QACzB,cAAU,mBAAM,IAAI,WAAW;AAAA,MACjC,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA;AAEH;AAaO,IAAM,mBAAe,2BAAW,uBAAuB;AAC9D,IAAO,wBAAQ;",
|
|
6
6
|
"names": ["clsx", "_jsxs", "_jsx"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { format, isSameDay, subMonths, addMonths, startOfDay, isEqual, addDays, subWeeks, addWeeks, isSameMonth, startOfWeek, endOfWeek } from "date-fns";
|
|
3
3
|
import { __, _n, sprintf, isRTL } from "@wordpress/i18n";
|
|
4
4
|
import { arrowLeft, arrowRight } from "@wordpress/icons";
|
|
5
|
-
import {
|
|
5
|
+
import { getSettings, gmdateI18n } from "@wordpress/date";
|
|
6
6
|
import { useState, useRef, useEffect } from "@wordpress/element";
|
|
7
7
|
import { useLilius } from "./use-lilius";
|
|
8
8
|
import { Wrapper, Navigator, ViewPreviousMonthButton, ViewNextMonthButton, NavigatorHeading, Calendar, DayOfWeek, DayButton } from "./styles";
|
|
@@ -58,8 +58,8 @@ function DatePicker({
|
|
|
58
58
|
}), /* @__PURE__ */ _jsxs(NavigatorHeading, {
|
|
59
59
|
level: 3,
|
|
60
60
|
children: [/* @__PURE__ */ _jsx("strong", {
|
|
61
|
-
children:
|
|
62
|
-
}), " ",
|
|
61
|
+
children: gmdateI18n("F", viewing)
|
|
62
|
+
}), " ", gmdateI18n("Y", viewing)]
|
|
63
63
|
}), /* @__PURE__ */ _jsx(ViewNextMonthButton, {
|
|
64
64
|
icon: isRTL() ? arrowLeft : arrowRight,
|
|
65
65
|
variant: "tertiary",
|
|
@@ -75,7 +75,7 @@ function DatePicker({
|
|
|
75
75
|
onFocus: () => setIsFocusWithinCalendar(true),
|
|
76
76
|
onBlur: () => setIsFocusWithinCalendar(false),
|
|
77
77
|
children: [calendar[0][0].map((day) => /* @__PURE__ */ _jsx(DayOfWeek, {
|
|
78
|
-
children:
|
|
78
|
+
children: gmdateI18n("D", day)
|
|
79
79
|
}, day.toString())), calendar[0].map((week) => week.map((day, index) => {
|
|
80
80
|
if (!isSameMonth(day, viewing)) {
|
|
81
81
|
return null;
|
|
@@ -169,14 +169,14 @@ function Day({
|
|
|
169
169
|
hasEvents: numEvents > 0,
|
|
170
170
|
onClick,
|
|
171
171
|
onKeyDown,
|
|
172
|
-
children:
|
|
172
|
+
children: gmdateI18n("j", day)
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
function getDayLabel(date, isSelected, numEvents) {
|
|
176
176
|
const {
|
|
177
177
|
formats
|
|
178
178
|
} = getSettings();
|
|
179
|
-
const localizedDate =
|
|
179
|
+
const localizedDate = gmdateI18n(formats.date, date);
|
|
180
180
|
if (isSelected && numEvents > 0) {
|
|
181
181
|
return sprintf(
|
|
182
182
|
// translators: 1: The calendar date. 2: Number of events on the calendar date.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/date-time/date/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { format, isSameDay, subMonths, addMonths, startOfDay, isEqual, addDays, subWeeks, addWeeks, isSameMonth, startOfWeek, endOfWeek } from 'date-fns';\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,QAAQ,WAAW,WAAW,WAAW,YAAY,SAAS,SAAS,UAAU,UAAU,aAAa,aAAa,iBAAiB;AAI/I,SAAS,IAAI,IAAI,SAAS,aAAa;AACvC,SAAS,WAAW,kBAAkB;AACtC,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { format, isSameDay, subMonths, addMonths, startOfDay, isEqual, addDays, subWeeks, addWeeks, isSameMonth, startOfWeek, endOfWeek } from 'date-fns';\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport { getSettings, gmdateI18n } from '@wordpress/date';\nimport { useState, useRef, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLilius } from './use-lilius';\nimport { Wrapper, Navigator, ViewPreviousMonthButton, ViewNextMonthButton, NavigatorHeading, Calendar, DayOfWeek, DayButton } from './styles';\nimport { inputToDate } from '../utils';\nimport { TIMEZONELESS_FORMAT } from '../constants';\n\n/**\n * DatePicker is a React component that renders a calendar for date selection.\n *\n * ```jsx\n * import { DatePicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDatePicker = () => {\n * const [ date, setDate ] = useState( new Date() );\n *\n * return (\n * <DatePicker\n * currentDate={ date }\n * onChange={ ( newDate ) => setDate( newDate ) }\n * />\n * );\n * };\n * ```\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function DatePicker({\n currentDate,\n onChange,\n events = [],\n isInvalidDate,\n onMonthPreviewed,\n startOfWeek: weekStartsOn = 0\n}) {\n const date = currentDate ? inputToDate(currentDate) : new Date();\n const {\n calendar,\n viewing,\n setSelected,\n setViewing,\n isSelected,\n viewPreviousMonth,\n viewNextMonth\n } = useLilius({\n selected: [startOfDay(date)],\n viewing: startOfDay(date),\n weekStartsOn\n });\n\n // Used to implement a roving tab index. Tracks the day that receives focus\n // when the user tabs into the calendar.\n const [focusable, setFocusable] = useState(startOfDay(date));\n\n // Allows us to only programmatically focus() a day when focus was already\n // within the calendar. This stops us stealing focus from e.g. a TimePicker\n // input.\n const [isFocusWithinCalendar, setIsFocusWithinCalendar] = useState(false);\n\n // Update internal state when currentDate prop changes.\n const [prevCurrentDate, setPrevCurrentDate] = useState(currentDate);\n if (currentDate !== prevCurrentDate) {\n setPrevCurrentDate(currentDate);\n setSelected([startOfDay(date)]);\n setViewing(startOfDay(date));\n setFocusable(startOfDay(date));\n }\n return /*#__PURE__*/_jsxs(Wrapper, {\n className: \"components-datetime__date\",\n role: \"application\",\n \"aria-label\": __('Calendar'),\n children: [/*#__PURE__*/_jsxs(Navigator, {\n children: [/*#__PURE__*/_jsx(ViewPreviousMonthButton, {\n icon: isRTL() ? arrowRight : arrowLeft,\n variant: \"tertiary\",\n \"aria-label\": __('View previous month'),\n onClick: () => {\n viewPreviousMonth();\n setFocusable(subMonths(focusable, 1));\n onMonthPreviewed?.(format(subMonths(viewing, 1), TIMEZONELESS_FORMAT));\n },\n size: \"compact\"\n }), /*#__PURE__*/_jsxs(NavigatorHeading, {\n level: 3,\n children: [/*#__PURE__*/_jsx(\"strong\", {\n children: gmdateI18n('F', viewing)\n }), ' ', gmdateI18n('Y', viewing)]\n }), /*#__PURE__*/_jsx(ViewNextMonthButton, {\n icon: isRTL() ? arrowLeft : arrowRight,\n variant: \"tertiary\",\n \"aria-label\": __('View next month'),\n onClick: () => {\n viewNextMonth();\n setFocusable(addMonths(focusable, 1));\n onMonthPreviewed?.(format(addMonths(viewing, 1), TIMEZONELESS_FORMAT));\n },\n size: \"compact\"\n })]\n }), /*#__PURE__*/_jsxs(Calendar, {\n onFocus: () => setIsFocusWithinCalendar(true),\n onBlur: () => setIsFocusWithinCalendar(false),\n children: [calendar[0][0].map(day => /*#__PURE__*/_jsx(DayOfWeek, {\n children: gmdateI18n('D', day)\n }, day.toString())), calendar[0].map(week => week.map((day, index) => {\n if (!isSameMonth(day, viewing)) {\n return null;\n }\n return /*#__PURE__*/_jsx(Day, {\n day: day,\n column: index + 1,\n isSelected: isSelected(day),\n isFocusable: isEqual(day, focusable),\n isFocusAllowed: isFocusWithinCalendar,\n isToday: isSameDay(day, new Date()),\n isInvalid: isInvalidDate ? isInvalidDate(day) : false,\n numEvents: events.filter(event => isSameDay(event.date, day)).length,\n onClick: () => {\n setSelected([day]);\n setFocusable(day);\n onChange?.(format(\n // Don't change the selected date's time fields.\n new Date(day.getFullYear(), day.getMonth(), day.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()), TIMEZONELESS_FORMAT));\n },\n onKeyDown: event => {\n let nextFocusable;\n if (event.key === 'ArrowLeft') {\n nextFocusable = addDays(day, isRTL() ? 1 : -1);\n }\n if (event.key === 'ArrowRight') {\n nextFocusable = addDays(day, isRTL() ? -1 : 1);\n }\n if (event.key === 'ArrowUp') {\n nextFocusable = subWeeks(day, 1);\n }\n if (event.key === 'ArrowDown') {\n nextFocusable = addWeeks(day, 1);\n }\n if (event.key === 'PageUp') {\n nextFocusable = subMonths(day, 1);\n }\n if (event.key === 'PageDown') {\n nextFocusable = addMonths(day, 1);\n }\n if (event.key === 'Home') {\n nextFocusable = startOfWeek(day);\n }\n if (event.key === 'End') {\n nextFocusable = startOfDay(endOfWeek(day));\n }\n if (nextFocusable) {\n event.preventDefault();\n setFocusable(nextFocusable);\n if (!isSameMonth(nextFocusable, viewing)) {\n setViewing(nextFocusable);\n onMonthPreviewed?.(format(nextFocusable, TIMEZONELESS_FORMAT));\n }\n }\n }\n }, day.toString());\n }))]\n })]\n });\n}\nfunction Day({\n day,\n column,\n isSelected,\n isFocusable,\n isFocusAllowed,\n isToday,\n isInvalid,\n numEvents,\n onClick,\n onKeyDown\n}) {\n const ref = useRef();\n\n // Focus the day when it becomes focusable, e.g. because an arrow key is\n // pressed. Only do this if focus is allowed - this stops us stealing focus\n // from e.g. a TimePicker input.\n useEffect(() => {\n if (ref.current && isFocusable && isFocusAllowed) {\n ref.current.focus();\n }\n // isFocusAllowed is not a dep as there is no point calling focus() on\n // an already focused element.\n }, [isFocusable]);\n return /*#__PURE__*/_jsx(DayButton, {\n __next40pxDefaultSize: true,\n ref: ref,\n className: \"components-datetime__date__day\" // Unused, for backwards compatibility.\n ,\n disabled: isInvalid,\n tabIndex: isFocusable ? 0 : -1,\n \"aria-label\": getDayLabel(day, isSelected, numEvents),\n column: column,\n isSelected: isSelected,\n isToday: isToday,\n hasEvents: numEvents > 0,\n onClick: onClick,\n onKeyDown: onKeyDown,\n children: gmdateI18n('j', day)\n });\n}\nfunction getDayLabel(date, isSelected, numEvents) {\n const {\n formats\n } = getSettings();\n const localizedDate = gmdateI18n(formats.date, date);\n if (isSelected && numEvents > 0) {\n return sprintf(\n // translators: 1: The calendar date. 2: Number of events on the calendar date.\n _n('%1$s. Selected. There is %2$d event', '%1$s. Selected. There are %2$d events', numEvents), localizedDate, numEvents);\n } else if (isSelected) {\n return sprintf(\n // translators: 1: The calendar date.\n __('%1$s. Selected'), localizedDate);\n } else if (numEvents > 0) {\n return sprintf(\n // translators: 1: The calendar date. 2: Number of events on the calendar date.\n _n('%1$s. There is %2$d event', '%1$s. There are %2$d events', numEvents), localizedDate, numEvents);\n }\n return localizedDate;\n}\nexport default DatePicker;"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,QAAQ,WAAW,WAAW,WAAW,YAAY,SAAS,SAAS,UAAU,UAAU,aAAa,aAAa,iBAAiB;AAI/I,SAAS,IAAI,IAAI,SAAS,aAAa;AACvC,SAAS,WAAW,kBAAkB;AACtC,SAAS,aAAa,kBAAkB;AACxC,SAAS,UAAU,QAAQ,iBAAiB;AAK5C,SAAS,iBAAiB;AAC1B,SAAS,SAAS,WAAW,yBAAyB,qBAAqB,kBAAkB,UAAU,WAAW,iBAAiB;AACnI,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AAqBpC,SAAS,OAAO,MAAM,QAAQ,aAAa;AACpC,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA,SAAS,CAAC;A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AA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,MAAM,OAAO;AAKnB,YAAU,MAAM;AACd,QAAI,IAAI,WAAW,eAAe,gBAAgB;AAChD,UAAI,QAAQ,MAAM;AAAA,IACpB;AAAA,EAGF,GAAG,CAAC,WAAW,CAAC;AAChB,SAAoB,qBAAK,WAAW;AAAA,IAClC,uBAAuB;AAAA,IACvB;AAAA,IACA,WAAW;AAAA,IAEX,UAAU;AAAA,IACV,UAAU,cAAc,IAAI;AAAA,IAC5B,cAAc,YAAY,KAAK,YAAY,SAAS;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,YAAY;AAAA,IACvB;AAAA,IACA;AAAA,IACA,UAAU,WAAW,KAAK,GAAG;AAAA,EAC/B,CAAC;AACH;AACA,SAAS,YAAY,MAAM,YAAY,WAAW;AAChD,QAAM;AAAA,IACJ;AAAA,EACF,IAAI,YAAY;AAChB,QAAM,gBAAgB,WAAW,QAAQ,MAAM,IAAI;AACnD,MAAI,cAAc,YAAY,GAAG;AAC/B,WAAO;AAAA;AAAA,MAEP,GAAG,uCAAuC,yCAAyC,SAAS;AAAA,MAAG;AAAA,MAAe;AAAA,IAAS;AAAA,EACzH,WAAW,YAAY;AACrB,WAAO;AAAA;AAAA,MAEP,GAAG,gBAAgB;AAAA,MAAG;AAAA,IAAa;AAAA,EACrC,WAAW,YAAY,GAAG;AACxB,WAAO;AAAA;AAAA,MAEP,GAAG,6BAA6B,+BAA+B,SAAS;AAAA,MAAG;AAAA,MAAe;AAAA,IAAS;AAAA,EACrG;AACA,SAAO;AACT;AACA,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// packages/components/src/date-time/utils.ts
|
|
2
2
|
import { toDate } from "date-fns";
|
|
3
|
+
import { UTCDateMini } from "@date-fns/utc";
|
|
3
4
|
import { COMMIT, PRESS_DOWN, PRESS_UP } from "../input-control/reducer/actions";
|
|
4
5
|
function inputToDate(input) {
|
|
5
6
|
if (typeof input === "string") {
|
|
6
|
-
|
|
7
|
+
const hasTimezone = /Z|[+-]\d{2}(:?\d{2})?$/.test(input);
|
|
8
|
+
return hasTimezone ? new Date(input) : new UTCDateMini(input + "Z");
|
|
7
9
|
}
|
|
8
10
|
return toDate(input);
|
|
9
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/date-time/utils.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { toDate } from 'date-fns';\n\n/**\n * Internal dependencies\n */\n\nimport { COMMIT, PRESS_DOWN, PRESS_UP } from '../input-control/reducer/actions';\n\n/**\n * Like date-
|
|
5
|
-
"mappings": ";AAGA,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { toDate } from 'date-fns';\nimport { UTCDateMini } from '@date-fns/utc';\n\n/**\n * Internal dependencies\n */\n\nimport { COMMIT, PRESS_DOWN, PRESS_UP } from '../input-control/reducer/actions';\n\n/**\n * Like date-fns's toDate, but tries to guess the format when a string is\n * given. For timezoneless strings, parse it as UTC using `@date-fns/utc` to\n * ensure calendar dates remain consistent across different browser timezones.\n *\n * @param input Value to turn into a date.\n */\nexport function inputToDate(input) {\n if (typeof input === 'string') {\n // Strings without timezone indicators are parsed as UTC to prevent day-\n // shift bugs across browser timezones. Note that JavaScript doesn't\n // fully support ISO-8601 time strings, so the behavior of passing these\n // through to the Date constructor is non-deterministic.\n //\n // See: https://tc39.es/ecma262/#sec-date-time-string-format\n const hasTimezone = /Z|[+-]\\d{2}(:?\\d{2})?$/.test(input);\n return hasTimezone ? new Date(input) : new UTCDateMini(input + 'Z');\n }\n return toDate(input);\n}\n\n/**\n * Converts a 12-hour time to a 24-hour time.\n * @param hours\n * @param isPm\n */\nexport function from12hTo24h(hours, isPm) {\n return isPm ? (hours % 12 + 12) % 24 : hours % 12;\n}\n\n/**\n * Converts a 24-hour time to a 12-hour time.\n * @param hours\n */\nexport function from24hTo12h(hours) {\n return hours % 12 || 12;\n}\n\n/**\n * Creates an InputControl reducer used to pad an input so that it is always a\n * given width. For example, the hours and minutes inputs are padded to 2 so\n * that '4' appears as '04'.\n *\n * @param pad How many digits the value should be.\n */\nexport function buildPadInputStateReducer(pad) {\n return (state, action) => {\n const nextState = {\n ...state\n };\n if (action.type === COMMIT || action.type === PRESS_UP || action.type === PRESS_DOWN) {\n if (nextState.value !== undefined) {\n nextState.value = nextState.value.toString().padStart(pad, '0');\n }\n }\n return nextState;\n };\n}\n\n/**\n * Validates the target of a React event to ensure it is an input element and\n * that the input is valid.\n * @param event\n */\nexport function validateInputElementTarget(event) {\n var _ownerDocument$defaul;\n // `instanceof` checks need to get the instance definition from the\n // corresponding window object \u2014 therefore, the following logic makes\n // the component work correctly even when rendered inside an iframe.\n const HTMLInputElementInstance = (_ownerDocument$defaul = event.target?.ownerDocument.defaultView?.HTMLInputElement) !== null && _ownerDocument$defaul !== void 0 ? _ownerDocument$defaul : HTMLInputElement;\n if (!(event.target instanceof HTMLInputElementInstance)) {\n return false;\n }\n return event.target.validity.valid;\n}"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAM5B,SAAS,QAAQ,YAAY,gBAAgB;AAStC,SAAS,YAAY,OAAO;AACjC,MAAI,OAAO,UAAU,UAAU;AAO7B,UAAM,cAAc,yBAAyB,KAAK,KAAK;AACvD,WAAO,cAAc,IAAI,KAAK,KAAK,IAAI,IAAI,YAAY,QAAQ,GAAG;AAAA,EACpE;AACA,SAAO,OAAO,KAAK;AACrB;AAOO,SAAS,aAAa,OAAO,MAAM;AACxC,SAAO,QAAQ,QAAQ,KAAK,MAAM,KAAK,QAAQ;AACjD;AAMO,SAAS,aAAa,OAAO;AAClC,SAAO,QAAQ,MAAM;AACvB;AASO,SAAS,0BAA0B,KAAK;AAC7C,SAAO,CAAC,OAAO,WAAW;AACxB,UAAM,YAAY;AAAA,MAChB,GAAG;AAAA,IACL;AACA,QAAI,OAAO,SAAS,UAAU,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;AACpF,UAAI,UAAU,UAAU,QAAW;AACjC,kBAAU,QAAQ,UAAU,MAAM,SAAS,EAAE,SAAS,KAAK,GAAG;AAAA,MAChE;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;AAOO,SAAS,2BAA2B,OAAO;AAChD,MAAI;AAIJ,QAAM,4BAA4B,wBAAwB,MAAM,QAAQ,cAAc,aAAa,sBAAsB,QAAQ,0BAA0B,SAAS,wBAAwB;AAC5L,MAAI,EAAE,MAAM,kBAAkB,2BAA2B;AACvD,WAAO;AAAA,EACT;AACA,SAAO,MAAM,OAAO,SAAS;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/components/src/external-link/index.tsx
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { __ } from "@wordpress/i18n";
|
|
3
|
+
import { __, isRTL } from "@wordpress/i18n";
|
|
4
4
|
import { forwardRef } from "@wordpress/element";
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
function UnforwardedExternalLink(props, ref) {
|
|
@@ -41,7 +41,7 @@ function UnforwardedExternalLink(props, ref) {
|
|
|
41
41
|
/* translators: accessibility text */
|
|
42
42
|
__("(opens in a new tab)")
|
|
43
43
|
),
|
|
44
|
-
children: "\u2197"
|
|
44
|
+
children: isRTL() ? "\u2196" : "\u2197"
|
|
45
45
|
})]
|
|
46
46
|
})
|
|
47
47
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/external-link/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedExternalLink(props, ref) {\n const {\n href,\n children,\n className,\n rel = '',\n ...additionalProps\n } = props;\n const optimizedRel = [...new Set([...rel.split(' '), 'external', 'noreferrer', 'noopener'].filter(Boolean))].join(' ');\n const classes = clsx('components-external-link', className);\n /* Anchor links are perceived as external links.\n This constant helps check for on page anchor links,\n to prevent them from being opened in the editor. */\n const isInternalAnchor = !!href?.startsWith('#');\n const onClickHandler = event => {\n if (isInternalAnchor) {\n event.preventDefault();\n }\n if (props.onClick) {\n props.onClick(event);\n }\n };\n return /*#__PURE__*/ /* eslint-disable react/jsx-no-target-blank */_jsxs(\"a\", {\n ...additionalProps,\n className: classes,\n href: href,\n onClick: onClickHandler,\n target: \"_blank\",\n rel: optimizedRel,\n ref: ref,\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__contents\",\n children: children\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__icon\",\n \"aria-label\": /* translators: accessibility text */\n __('(opens in a new tab)'),\n children:
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedExternalLink(props, ref) {\n const {\n href,\n children,\n className,\n rel = '',\n ...additionalProps\n } = props;\n const optimizedRel = [...new Set([...rel.split(' '), 'external', 'noreferrer', 'noopener'].filter(Boolean))].join(' ');\n const classes = clsx('components-external-link', className);\n /* Anchor links are perceived as external links.\n This constant helps check for on page anchor links,\n to prevent them from being opened in the editor. */\n const isInternalAnchor = !!href?.startsWith('#');\n const onClickHandler = event => {\n if (isInternalAnchor) {\n event.preventDefault();\n }\n if (props.onClick) {\n props.onClick(event);\n }\n };\n return /*#__PURE__*/ /* eslint-disable react/jsx-no-target-blank */_jsxs(\"a\", {\n ...additionalProps,\n className: classes,\n href: href,\n onClick: onClickHandler,\n target: \"_blank\",\n rel: optimizedRel,\n ref: ref,\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__contents\",\n children: children\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-external-link__icon\",\n \"aria-label\": /* translators: accessibility text */\n __('(opens in a new tab)'),\n children: isRTL() ? '\\u2196' : '\\u2197'\n })]\n })\n /* eslint-enable react/jsx-no-target-blank */;\n}\n\n/**\n * Link to an external resource.\n *\n * ```jsx\n * import { ExternalLink } from '@wordpress/components';\n *\n * const MyExternalLink = () => (\n * <ExternalLink href=\"https://wordpress.org\">WordPress.org</ExternalLink>\n * );\n * ```\n */\nexport const ExternalLink = forwardRef(UnforwardedExternalLink);\nexport default ExternalLink;"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,IAAI,aAAa;AAC1B,SAAS,kBAAkB;AAK3B,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,wBAAwB,OAAO,KAAK;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,eAAe,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,MAAM,GAAG,GAAG,YAAY,cAAc,UAAU,EAAE,OAAO,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG;AACrH,QAAM,UAAU,KAAK,4BAA4B,SAAS;AAI1D,QAAM,mBAAmB,CAAC,CAAC,MAAM,WAAW,GAAG;AAC/C,QAAM,iBAAiB,WAAS;AAC9B,QAAI,kBAAkB;AACpB,YAAM,eAAe;AAAA,IACvB;AACA,QAAI,MAAM,SAAS;AACjB,YAAM,QAAQ,KAAK;AAAA,IACrB;AAAA,EACF;AACA;AAAA;AAAA,IAAmE,sBAAM,KAAK;AAAA,MAC5E,GAAG;AAAA,MACH,WAAW;AAAA,MACX;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,KAAK;AAAA,MACL;AAAA,MACA,UAAU,CAAc,qBAAK,QAAQ;AAAA,QACnC,WAAW;AAAA,QACX;AAAA,MACF,CAAC,GAAgB,qBAAK,QAAQ;AAAA,QAC5B,WAAW;AAAA,QACX;AAAA;AAAA,UACA,GAAG,sBAAsB;AAAA;AAAA,QACzB,UAAU,MAAM,IAAI,WAAW;AAAA,MACjC,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA;AAEH;AAaO,IAAM,eAAe,WAAW,uBAAuB;AAC9D,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2009,9 +2009,6 @@ body.is-dragging-components-draggable {
|
|
|
2009
2009
|
margin: 8px 0 0 8px;
|
|
2010
2010
|
position: static;
|
|
2011
2011
|
}
|
|
2012
|
-
.components-guide .components-modal__header .components-button:hover svg {
|
|
2013
|
-
fill: #fff;
|
|
2014
|
-
}
|
|
2015
2012
|
.components-guide .components-guide__container {
|
|
2016
2013
|
display: flex;
|
|
2017
2014
|
flex-direction: column;
|
|
@@ -2358,6 +2355,14 @@ body.is-dragging-components-draggable {
|
|
|
2358
2355
|
max-height: 70%;
|
|
2359
2356
|
}
|
|
2360
2357
|
}
|
|
2358
|
+
.components-modal__frame.is-full-screen .components-modal__content {
|
|
2359
|
+
display: flex;
|
|
2360
|
+
margin-bottom: 32px;
|
|
2361
|
+
padding-bottom: 0;
|
|
2362
|
+
}
|
|
2363
|
+
.components-modal__frame.is-full-screen .components-modal__content > :last-child {
|
|
2364
|
+
flex: 1;
|
|
2365
|
+
}
|
|
2361
2366
|
|
|
2362
2367
|
@keyframes components-modal__appear-animation {
|
|
2363
2368
|
from {
|
package/build-style/style.css
CHANGED
|
@@ -2014,9 +2014,6 @@ body.is-dragging-components-draggable {
|
|
|
2014
2014
|
margin: 8px 8px 0 0;
|
|
2015
2015
|
position: static;
|
|
2016
2016
|
}
|
|
2017
|
-
.components-guide .components-modal__header .components-button:hover svg {
|
|
2018
|
-
fill: #fff;
|
|
2019
|
-
}
|
|
2020
2017
|
.components-guide .components-guide__container {
|
|
2021
2018
|
display: flex;
|
|
2022
2019
|
flex-direction: column;
|
|
@@ -2363,6 +2360,14 @@ body.is-dragging-components-draggable {
|
|
|
2363
2360
|
max-height: 70%;
|
|
2364
2361
|
}
|
|
2365
2362
|
}
|
|
2363
|
+
.components-modal__frame.is-full-screen .components-modal__content {
|
|
2364
|
+
display: flex;
|
|
2365
|
+
margin-bottom: 32px;
|
|
2366
|
+
padding-bottom: 0;
|
|
2367
|
+
}
|
|
2368
|
+
.components-modal__frame.is-full-screen .components-modal__content > :last-child {
|
|
2369
|
+
flex: 1;
|
|
2370
|
+
}
|
|
2366
2371
|
|
|
2367
2372
|
@keyframes components-modal__appear-animation {
|
|
2368
2373
|
from {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/alignment-matrix-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/alignment-matrix-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAStD;;GAEG;AACH,OAAO,sBAAsB,MAAM,IAAI,CAAC;AAExC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,sBAAsB,CAkB9C,CAAC;AACF,eAAe,IAAI,CAAC;AAqBpB,eAAO,MAAM,OAAO,gSAAsB,CAAC;AAE3C,eAAO,MAAM,gBAAgB,mCAS5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/angle-picker-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/angle-picker-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,kBAAkB,CAgB1C,CAAC;AAEF,eAAe,IAAI,CAAC;AAsBpB,eAAO,MAAM,OAAO;;uCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/box-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/box-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,UAAU,MAAM,KAAK,CAAC;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,UAAU,CAalC,CAAC;AACF,eAAe,IAAI,CAAC;AAqBpB,eAAO,MAAM,OAAO,yHAAkC,CAAC;AAMvD,eAAO,MAAM,UAAU,yHAAgC,CAAC;AAKxD,eAAO,MAAM,cAAc,yHAAgC,CAAC;AAM5D,eAAO,MAAM,UAAU,yHAAgC,CAAC;AAMxD,eAAO,MAAM,aAAa,yHAAgC,CAAC;AAM3D,eAAO,MAAM,2BAA2B,yHAAgC,CAAC;AAOzE,eAAO,MAAM,kBAAkB,yHAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/circular-option-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAKtD;;GAEG;AACH,OAAO,oBAAoB,MAAM,IAAI,CAAC;AAOtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/circular-option-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAKtD;;GAEG;AACH,OAAO,oBAAoB,MAAM,IAAI,CAAC;AAOtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,oBAAoB,CA4C5C,CAAC;AACF,eAAe,IAAI,CAAC;AAgDpB,eAAO,MAAM,OAAO,mIAAsB,CAAC;AAM3C,eAAO,MAAM,SAAS,mIAAsB,CAAC;AAM7C,eAAO,MAAM,mBAAmB,mIAAsB,CAAC;AAiBvD,eAAO,MAAM,gBAAgB,mIAAsB,CAAC;AAOpD,eAAO,MAAM,sBAAsB,mIAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/color-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/color-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,WAAW,CAiBnC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAE,OAAO,WAAW,CAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/combobox-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/combobox-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,eAAe,MAAM,IAAI,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAqBrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,CAevC,CAAC;AACF,eAAe,IAAI,CAAC;AA6BpB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;EAAsB,CAAC;AAQ3C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;EAAsB,CAAC;AAqCxD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;EAAsB,CAAC;AAWvD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;EAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/confirm-dialog/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/confirm-dialog/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAYtD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CAoBrC,CAAC;AAEF,eAAe,IAAI,CAAC;AAsCpB,eAAO,MAAM,OAAO,uXAAsB,CAAC;AA+C3C,eAAO,MAAM,sBAAsB,uXAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-gradient-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-gradient-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,oBAAoB,MAAM,KAAK,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,oBAAoB,CAW5C,CAAC;AACF,eAAe,IAAI,CAAC;AAkBpB,eAAO,MAAM,OAAO,mIAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,mBAAmB,MAAM,IAAI,CAAC;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,mBAAmB,CA4B3C,CAAC;AACF,eAAe,IAAI,CAAC;AAqBpB,eAAO,MAAM,OAAO,kKAAsB,CAAC;AA6B3C,eAAO,MAAM,cAAc,kKAAsB,CAAC;AAmBlD,eAAO,MAAM,SAAS,kKAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,qBAAqB,MAAM,IAAI,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,qBAAqB,MAAM,IAAI,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,qBAAqB,CAiC7C,CAAC;AACF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO;;;;;;;oQAAsB,CAAC;AAmB3C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;oQAAsB,CAAC;AAoCrD;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;oQAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-time/date/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAchD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAE,EAC3B,WAAW,EACX,QAAQ,EACR,MAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EAAE,YAAgB,GAC7B,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-time/date/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAchD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAE,EAC3B,WAAW,EACX,QAAQ,EACR,MAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EAAE,YAAgB,GAC7B,EAAE,eAAe,+BA8LjB;AA+FD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/date-time/date-time/test/index.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../src/date-time/test/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
import type { InputState } from '../input-control/reducer/state';
|
|
5
5
|
import type { InputAction } from '../input-control/reducer/actions';
|
|
6
6
|
/**
|
|
7
|
-
* Like date-
|
|
8
|
-
* given.
|
|
7
|
+
* Like date-fns's toDate, but tries to guess the format when a string is
|
|
8
|
+
* given. For timezoneless strings, parse it as UTC using `@date-fns/utc` to
|
|
9
|
+
* ensure calendar dates remain consistent across different browser timezones.
|
|
9
10
|
*
|
|
10
11
|
* @param input Value to turn into a date.
|
|
11
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/date-time/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/date-time/utils.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAE,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAI,IAAI,CAYjE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,UAEzD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAE,KAAK,EAAE,MAAM,UAE1C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAE,GAAG,EAAE,MAAM,IAC5C,OAAO,UAAU,EAAE,QAAQ,WAAW;;;;;;;;;EAe/C;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAE,KAAK,EAAE,KAAK,CAAC,cAAc,WAatE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/draggable/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/draggable/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAWtD;;GAEG;AACH,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,SAAS,CAiBjC,CAAC;AACF,eAAe,IAAI,CAAC;AAuEpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,SAAS,CAA+B,CAAC;AAG/E;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,OAAO,CAAE,OAAO,SAAS,CACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/drop-zone/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/drop-zone/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,QAAQ,MAAM,IAAI,CAAC;AAI1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,QAAQ,CAoBhC,CAAC;AACF,eAAe,IAAI,CAAC;AAiBpB,eAAO,MAAM,OAAO,0SAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD;;GAEG;AACH,OAAO,QAAQ,MAAM,IAAI,CAAC;AAM1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,QAAQ,CA8BhC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAE,OAAO,QAAQ,CAa9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAE,OAAO,QAAQ,CAYtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAE,OAAO,QAAQ,CAYpD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAE,OAAO,QAAQ,CAkBpD,CAAC"}
|