@pingux/astro 2.245.1-alpha.0 → 2.246.0-alpha.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.
Files changed (43) hide show
  1. package/lib/cjs/components/Calendar/CalendarCell.js +8 -2
  2. package/lib/cjs/components/DatePicker/DateField.js +24 -5
  3. package/lib/cjs/components/DatePicker/DatePicker.js +19 -9
  4. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +1 -0
  5. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +3 -2
  6. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +17 -0
  7. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +17 -0
  8. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/calendar.d.ts +113 -0
  9. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/calendar.js +128 -0
  10. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.d.ts +1822 -0
  11. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.js +42 -2
  12. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +112 -0
  13. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +3 -1
  14. package/lib/cjs/styles/themeOverrides/onyxUiLibraryOverride.js +5 -1
  15. package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +1 -0
  16. package/lib/cjs/styles/themes/next-gen/colors/colors.js +1 -0
  17. package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
  18. package/lib/cjs/styles/themes/next-gen/forms.d.ts +2044 -214
  19. package/lib/cjs/styles/themes/next-gen/forms.js +48 -2
  20. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +1185 -90
  21. package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +22 -0
  22. package/lib/cjs/styles/themes/next-gen/variants/button.js +22 -0
  23. package/lib/cjs/styles/themes/next-gen/variants/calendar.d.ts +158 -0
  24. package/lib/cjs/styles/themes/next-gen/variants/calendar.js +172 -0
  25. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +157 -0
  26. package/lib/cjs/styles/themes/next-gen/variants/variants.js +2 -0
  27. package/lib/cjs/types/popoverContainer.d.ts +7 -2
  28. package/lib/components/Calendar/CalendarCell.js +9 -3
  29. package/lib/components/DatePicker/DateField.js +25 -6
  30. package/lib/components/DatePicker/DatePicker.js +20 -10
  31. package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +3 -2
  32. package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +17 -0
  33. package/lib/styles/themeOverrides/nextGenDarkMode/variants/calendar.js +122 -0
  34. package/lib/styles/themeOverrides/nextGenDarkMode/variants/forms.js +41 -1
  35. package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +3 -1
  36. package/lib/styles/themeOverrides/onyxUiLibraryOverride.js +5 -1
  37. package/lib/styles/themes/next-gen/colors/colors.js +1 -0
  38. package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
  39. package/lib/styles/themes/next-gen/forms.js +47 -1
  40. package/lib/styles/themes/next-gen/variants/button.js +22 -0
  41. package/lib/styles/themes/next-gen/variants/calendar.js +166 -0
  42. package/lib/styles/themes/next-gen/variants/variants.js +2 -0
  43. package/package.json +1 -1
@@ -8,9 +8,10 @@ import { useDateField } from '@react-aria/datepicker';
8
8
  import { useLocale } from '@react-aria/i18n';
9
9
  import { VisuallyHidden } from '@react-aria/visually-hidden';
10
10
  import { useDateFieldState } from '@react-stately/datepicker';
11
- import { useField, useStatusClasses } from '../../hooks';
11
+ import { useField, useGetTheme, useStatusClasses } from '../../hooks';
12
12
  import { Box, FieldHelperText, Icon, IconButton, Input, Label, Messages } from '../../index';
13
13
  import statuses from '../../utils/devUtils/constants/statuses';
14
+ import IconSymbol from '../Icon/IconSymbol';
14
15
  import DateSegment from './DateSegment';
15
16
 
16
17
  /**
@@ -46,6 +47,10 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
46
47
  ...other
47
48
  } = props;
48
49
  const [errorMessage, setErrorMessage] = useState('');
50
+ const {
51
+ themeState
52
+ } = useGetTheme();
53
+ const isOnyxTheme = themeState.isOnyx;
49
54
  const fieldRef = useRef(null);
50
55
  const inputRef = useRef(null);
51
56
  const labelRef = useRef(null);
@@ -146,10 +151,11 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
146
151
  */
147
152
 
148
153
  const formatHelpText = useMemo(() => {
149
- return (isLocalEnUS ? enUSSegments : segments).map(s => {
154
+ const displaySegments = isLocalEnUS ? enUSSegments : segments;
155
+ return displaySegments.map(s => {
150
156
  return s.text;
151
157
  }).join(' ');
152
- }, [hasFormatHelpText]);
158
+ }, [hasFormatHelpText, isLocalEnUS]);
153
159
  const handlePaste = useCallback(e => {
154
160
  const copiedValue = e.clipboardData.getData('text');
155
161
  let isNextAvailableDate;
@@ -197,7 +203,9 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
197
203
  }, [minValue, maxValue, unavailableRanges]);
198
204
  return ___EmotionJSX(Box, _extends({
199
205
  variant: "forms.input.fieldContainer"
200
- }, fieldContainerProps), ___EmotionJSX(Label, _extends({}, fieldLabelProps, {
206
+ }, fieldContainerProps, {
207
+ className: classNames
208
+ }), ___EmotionJSX(Label, _extends({}, fieldLabelProps, {
201
209
  ref: labelRef
202
210
  })), ___EmotionJSX(Box, _extends({
203
211
  isRow: true,
@@ -234,13 +242,24 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
234
242
  isDisabled: isDisabled || isReadOnly
235
243
  }, buttonProps, {
236
244
  "aria-label": toggleCalendarButtonAriaLabel
237
- }), ___EmotionJSX(Icon, {
245
+ }), isOnyxTheme ? ___EmotionJSX(IconSymbol, {
246
+ icon: "calendar_today",
247
+ size: 20,
248
+ sx: {
249
+ flexShrink: 0
250
+ },
251
+ title: {
252
+ name: 'Calendar Icon'
253
+ }
254
+ }) : ___EmotionJSX(Icon, {
238
255
  icon: CalendarIcon,
239
256
  title: {
240
257
  name: 'Calendar Icon'
241
258
  },
242
259
  size: 20
243
- })))), hasFormatHelpText && ___EmotionJSX(FieldHelperText, null, formatHelpText), errorMessage && ___EmotionJSX(Messages, {
260
+ })))), hasFormatHelpText && ___EmotionJSX(FieldHelperText, null, formatHelpText), helperText && ___EmotionJSX(FieldHelperText, {
261
+ status: status
262
+ }, helperText), errorMessage && ___EmotionJSX(Messages, {
244
263
  onClose: () => setErrorMessage('')
245
264
  }, ___EmotionJSX(Item, {
246
265
  key: "message1",
@@ -1,12 +1,14 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React, { forwardRef, useRef } from 'react';
3
3
  import { parseDate } from '@internationalized/date';
4
+ import { astroTokens } from '@pingux/onyx-tokens';
4
5
  import { useDatePicker } from '@react-aria/datepicker';
5
6
  import { FocusScope } from '@react-aria/focus';
6
7
  import { mergeProps } from '@react-aria/utils';
7
8
  import { useDatePickerState } from '@react-stately/datepicker';
8
9
  import { omit } from 'lodash/object';
9
- import { Calendar, FieldHelperText } from '../../index';
10
+ import { useGetTheme } from '../../hooks';
11
+ import { Calendar } from '../../index';
10
12
  import { getPendoID } from '../../utils/devUtils/constants/pendoID';
11
13
  import { isDateWithinRanges } from '../../utils/devUtils/props/isDateWithinRanges';
12
14
  import Popover from '../Popover/Popover';
@@ -46,6 +48,10 @@ const DatePicker = /*#__PURE__*/forwardRef((props, ref) => {
46
48
  } = props;
47
49
  const groupRef = useRef(null);
48
50
  const popoverRef = useRef(null);
51
+ const {
52
+ themeState
53
+ } = useGetTheme();
54
+ const isOnyxTheme = themeState.isOnyx;
49
55
 
50
56
  /**
51
57
  * This function is run against each date in the calendar
@@ -89,12 +95,18 @@ const DatePicker = /*#__PURE__*/forwardRef((props, ref) => {
89
95
  popoverRef: popoverRef,
90
96
  triggerRef: groupRef,
91
97
  state: state,
92
- offset: 15,
93
- crossOffset: 40,
94
- "data-testid": "popover-container"
95
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
- ,
97
- overflow: 'auto'
98
+ offset: isOnyxTheme ? 1 : 15,
99
+ crossOffset: isOnyxTheme ? -45 : 40,
100
+ "data-testid": "popover-container",
101
+ style: isOnyxTheme ? {
102
+ position: 'absolute',
103
+ overflow: 'auto',
104
+ borderRadius: astroTokens.radius.xl,
105
+ maxWidth: '312px'
106
+ } : {
107
+ position: 'absolute',
108
+ overflow: 'auto'
109
+ }
98
110
  }, ___EmotionJSX(FocusScope, {
99
111
  autoFocus: true,
100
112
  contain: true,
@@ -117,8 +129,6 @@ const DatePicker = /*#__PURE__*/forwardRef((props, ref) => {
117
129
  status: status,
118
130
  datePickerState: state,
119
131
  helpHintProps: helpHintProps
120
- })), calendar, helperText && ___EmotionJSX(FieldHelperText, {
121
- status: status
122
- }, helperText));
132
+ })), calendar);
123
133
  });
124
134
  export default DatePicker;
@@ -160,6 +160,7 @@ export const colors = {
160
160
  text: {
161
161
  primary: astroTokensDark.color.font.base,
162
162
  secondary: astroTokensDark.color.font.light,
163
+ reverse: astroTokensDark.color.font.reverse,
163
164
  error: astroTokensDark.color.font.error,
164
165
  message: 'white',
165
166
  fieldHelper: astroTokensDark.color.gray[400]
@@ -175,8 +176,8 @@ export const colors = {
175
176
  badge,
176
177
  codeEditor,
177
178
  critical: {
178
- bright: astroTokensDark.color.red[300],
179
- dark: astroTokensDark.color.red[100]
179
+ bright: astroTokensDark.color.red[500],
180
+ dark: astroTokensDark.color.red[500]
180
181
  },
181
182
  common
182
183
  };
@@ -84,6 +84,23 @@ const iconButtons = {
84
84
  modalHeaderCloseButton: {
85
85
  ...baseIconButton
86
86
  },
87
+ datePicker: {
88
+ containedIcon: {
89
+ width: 28,
90
+ height: 28,
91
+ minWidth: 18,
92
+ right: 20,
93
+ px: 0,
94
+ py: 0,
95
+ border: 'none',
96
+ '&.is-hovered': {
97
+ backgroundColor: 'light',
98
+ path: {
99
+ fill: astroTokensDark.color.gray[400]
100
+ }
101
+ }
102
+ }
103
+ },
87
104
  messageCloseButton: {
88
105
  ...baseIconButton,
89
106
  '&.is-hovered': {
@@ -0,0 +1,122 @@
1
+ import { astroTokensDark } from '@pingux/onyx-tokens';
2
+ const calendarBody = {
3
+ backgroundColor: 'backgroundBase',
4
+ '& > tr:nth-of-type(odd) ': {
5
+ backgroundColor: 'backgroundBase'
6
+ }
7
+ };
8
+ const calendarButton = {
9
+ color: 'text.primary',
10
+ '&.is-focused, &:focus-visible': {
11
+ outline: '2px solid',
12
+ outlineColor: 'focus',
13
+ outlineOffset: '2px',
14
+ borderRadius: astroTokensDark.radius.xl
15
+ },
16
+ '&.is-hovered': {
17
+ bg: astroTokensDark.color.gray[700],
18
+ color: 'text.primary',
19
+ cursor: 'pointer'
20
+ },
21
+ '&.is-selected': {
22
+ bg: 'active',
23
+ color: 'text.reverse',
24
+ '&.is-hovered': {
25
+ bg: 'active',
26
+ color: 'text.reverse'
27
+ }
28
+ },
29
+ '&.is-unavailable': {
30
+ color: 'text.primary',
31
+ bg: astroTokensDark.color.gray[750],
32
+ cursor: 'default'
33
+ },
34
+ '&:not(.is-outside-visible-range)&.is-extreme&:not(.is-completely-disabled)': {
35
+ color: 'text.primary',
36
+ bg: astroTokensDark.color.gray[750],
37
+ opacity: 1,
38
+ '&.is-hovered': {
39
+ backgroundColor: astroTokensDark.color.gray[750],
40
+ cursor: 'default'
41
+ }
42
+ },
43
+ '&.is-disabled': {
44
+ bg: astroTokensDark.color.gray[750],
45
+ cursor: 'default',
46
+ '&.is-hovered': {
47
+ bg: astroTokensDark.color.gray[750]
48
+ }
49
+ }
50
+ };
51
+ const calendarCell = {
52
+ color: 'text.primary',
53
+ '&.is-outside-month': {
54
+ opacity: 0.65,
55
+ backgroundColor: 'transparent',
56
+ color: 'text.secondary',
57
+ '& > [hidden]': {
58
+ color: 'text.secondary'
59
+ },
60
+ '&.is-completely-disabled': {
61
+ backgroundColor: 'transparent',
62
+ '& > [hidden]': {
63
+ color: 'text.secondary'
64
+ }
65
+ },
66
+ '&.is-unavailable': {
67
+ backgroundColor: astroTokensDark.color.gray[750],
68
+ color: 'text.primary',
69
+ '& > [hidden]': {
70
+ color: 'text.secondary'
71
+ },
72
+ '&.is-hovered': {
73
+ backgroundColor: astroTokensDark.color.gray[750],
74
+ color: 'text.primary'
75
+ }
76
+ },
77
+ '&.is-extreme:not(.is-completely-disabled):not(.is-unavailable)': {
78
+ backgroundColor: astroTokensDark.color.gray[750],
79
+ color: 'text.primary',
80
+ '& > [hidden]': {
81
+ color: 'text.secondary'
82
+ },
83
+ '&.is-hovered': {
84
+ backgroundColor: astroTokensDark.color.gray[750],
85
+ color: 'text.primary'
86
+ }
87
+ }
88
+ }
89
+ };
90
+ const calendarHeader = {
91
+ // Month/year title renders at #F6F8FA per the Figma spec; the shared itemTitle
92
+ // variant resolves to text.secondary (#C0C9D5) under the dark theme.
93
+ color: 'text.primary',
94
+ '& :is(div, span, h3)': {
95
+ color: 'inherit'
96
+ }
97
+ };
98
+ const columnHeader = {
99
+ color: 'text.primary',
100
+ borderBottom: '1px solid',
101
+ borderBottomColor: astroTokensDark.color.common.border,
102
+ pb: '32px',
103
+ mb: '0'
104
+ };
105
+ const calendarContainer = {
106
+ bg: 'backgroundBase',
107
+ color: 'text.primary',
108
+ border: '1px solid',
109
+ borderColor: astroTokensDark.color.common.border
110
+ };
111
+ const calendarRow = {
112
+ bg: 'backgroundBase'
113
+ };
114
+ export default {
115
+ calendarBody,
116
+ calendarButton,
117
+ calendarCell,
118
+ calendarContainer,
119
+ calendarHeader,
120
+ calendarRow,
121
+ columnHeader
122
+ };
@@ -1,6 +1,45 @@
1
1
  import { astroTokensDark } from '@pingux/onyx-tokens';
2
2
  import comboBox from './comboBox';
3
3
  import { fieldControlWrapper, input } from './input';
4
+ export const datePicker = {
5
+ inSlotContainer: {
6
+ minWidth: '400px'
7
+ },
8
+ inputField: {
9
+ ...input,
10
+ color: astroTokensDark.color.font.base,
11
+ width: '100%',
12
+ p: `${astroTokensDark.spacing.input['md-s']}px !important`,
13
+ pr: '44px !important',
14
+ '&:focus-within:not(.is-read-only)': {
15
+ borderColor: 'focus',
16
+ boxShadow: 'none',
17
+ outline: '1px solid',
18
+ outlineColor: 'focus',
19
+ outlineOffset: '0px'
20
+ },
21
+ '&.is-read-only': {
22
+ border: '1px solid',
23
+ borderColor: 'border.input',
24
+ backgroundColor: astroTokensDark.color.input['readonly-bg'],
25
+ boxShadow: 'none'
26
+ },
27
+ '&.is-disabled': {
28
+ opacity: 1,
29
+ border: '1px solid',
30
+ borderColor: 'border.input',
31
+ backgroundColor: 'disabled',
32
+ color: astroTokensDark.color.font.base,
33
+ boxShadow: 'none'
34
+ }
35
+ },
36
+ segment: {
37
+ color: astroTokensDark.color.font.base,
38
+ '&:empty': {
39
+ color: astroTokensDark.color.font.base
40
+ }
41
+ }
42
+ };
4
43
  export const select = {
5
44
  backgroundColor: 'backgroundBase',
6
45
  borderRadius: astroTokensDark.radius.input,
@@ -121,5 +160,6 @@ export default {
121
160
  },
122
161
  switch: switchable,
123
162
  comboBox,
124
- numberField
163
+ numberField,
164
+ datePicker
125
165
  };
@@ -2,6 +2,7 @@ import { astroTokensDark } from '@pingux/onyx-tokens';
2
2
  import { colors } from '../colors';
3
3
  import { avatar } from './avatar';
4
4
  import { box } from './box';
5
+ import calendar from './calendar';
5
6
  import callout from './callout';
6
7
  import { footer } from './footer';
7
8
  import iconBadge from './iconBadge';
@@ -231,6 +232,7 @@ export default {
231
232
  }
232
233
  }
233
234
  },
235
+ calendar,
234
236
  callout,
235
237
  table: {
236
238
  caption: {
@@ -315,7 +317,7 @@ export default {
315
317
  color: 'text.fieldHelper'
316
318
  },
317
319
  '&.is-error': {
318
- color: 'critical.bright'
320
+ color: astroTokensDark.color.font.error
319
321
  },
320
322
  '&.is-warning': {
321
323
  color: 'warning.bright'
@@ -103,7 +103,11 @@ const buttons = {
103
103
  datePicker: {
104
104
  containedIcon: {
105
105
  '&:not(.disabled):hover': {
106
- border: 'none'
106
+ border: 'none',
107
+ backgroundColor: astroTokens.color.gray[100],
108
+ path: {
109
+ fill: 'dark'
110
+ }
107
111
  },
108
112
  '&:focus': {
109
113
  border: 'none'
@@ -76,6 +76,7 @@ export const info = {
76
76
  const text = {
77
77
  primary: astroTokens.color.font.base,
78
78
  secondary: astroTokens.color.font.light,
79
+ reverse: astroTokens.color.font.reverse,
79
80
  error: astroTokens.color.font.error,
80
81
  message: astroTokens.color.gray[700],
81
82
  fieldHelper: astroTokens.color.font.light
@@ -1,4 +1,4 @@
1
- const nextGenConvertedComponents = ['AccordionGridGroup', 'AccordionGroup', 'ArrayField', 'AstroProvider', 'Avatar', 'Badge', 'Base Components', 'Breadcrumbs', 'Button', 'ButtonBar', 'Callout', 'Card', 'CheckboxField', 'CheckboxFieldGroup', 'CodeView', 'ColorField', 'ComboBoxField', 'CopyText', 'DataTable', 'EnvironmentBreadcrumb', 'GridList', 'HelpHint', 'Icon', 'MaterialSymbolIcon', 'IconBadge', 'IconButton', 'IconWrapper', 'ImageUploadField', 'Loader', 'Link', 'LinkSelectField', 'ListView', 'ListViewItem', 'Message', 'Messages', 'Modal', 'MultiValuesField', 'MultivaluesField', 'NavBar', 'NavList', 'NavigationHeader', 'NextGen ListViewItem', 'NumberField', 'OverlayPanel', 'PageHeader', 'Pagination', 'PanelHeader', 'PasswordField', 'PhoneNumberField', 'PopoverMenu', 'ProgressBar', 'RadioField', 'RadioGroupField', 'RangeCalendar', 'RequirementsList', 'RockerButtonGroup', 'SearchField', 'SelectField', 'Skeleton', 'SliderField', 'Stepper', 'Sticker Sheet', 'SwitchField', 'StatusIcon', 'Table', 'TableBase', 'Tabs', 'Text', 'TextAreaField', 'TextField', 'TooltipTrigger', 'Tree', 'ArrayField', 'ColorField', 'LinkSelectField', 'NumberField', 'SwitchField', 'Base Components', 'SliderField', 'ServerErrorBoundary', 'Avatar', 'Box', 'TimeField', 'LabelValuePairs'];
1
+ const nextGenConvertedComponents = ['AccordionGridGroup', 'AccordionGroup', 'ArrayField', 'AstroProvider', 'Avatar', 'Badge', 'Base Components', 'Breadcrumbs', 'Button', 'ButtonBar', 'Callout', 'Card', 'CheckboxField', 'CheckboxFieldGroup', 'CodeView', 'ColorField', 'ComboBoxField', 'CopyText', 'DataTable', 'DatePicker', 'EnvironmentBreadcrumb', 'GridList', 'HelpHint', 'Icon', 'MaterialSymbolIcon', 'IconBadge', 'IconButton', 'IconWrapper', 'ImageUploadField', 'Loader', 'Link', 'LinkSelectField', 'ListView', 'ListViewItem', 'Message', 'Messages', 'Modal', 'MultiValuesField', 'MultivaluesField', 'NavBar', 'NavList', 'NavigationHeader', 'NextGen ListViewItem', 'NumberField', 'OverlayPanel', 'PageHeader', 'Pagination', 'PanelHeader', 'PasswordField', 'PhoneNumberField', 'PopoverMenu', 'ProgressBar', 'RadioField', 'RadioGroupField', 'RangeCalendar', 'RequirementsList', 'RockerButtonGroup', 'SearchField', 'SelectField', 'Skeleton', 'SliderField', 'Stepper', 'Sticker Sheet', 'SwitchField', 'StatusIcon', 'Table', 'TableBase', 'Tabs', 'Text', 'TextAreaField', 'TextField', 'TooltipTrigger', 'Tree', 'ArrayField', 'ColorField', 'LinkSelectField', 'NumberField', 'SwitchField', 'Base Components', 'SliderField', 'ServerErrorBoundary', 'Avatar', 'Box', 'TimeField', 'LabelValuePairs'];
2
2
  export const componentSpecificNextGenBlacklist = {
3
3
  AstroProvider: ['Default', 'With Custom Theme Override'],
4
4
  Messages: ['Customization'],
@@ -157,6 +157,51 @@ export const timeField = {
157
157
  }
158
158
  }
159
159
  };
160
+ export const datePicker = {
161
+ inSlotContainer: {
162
+ '&:after': {
163
+ display: 'none'
164
+ },
165
+ minWidth: '400px'
166
+ },
167
+ inputField: {
168
+ ...input,
169
+ color: 'font.base',
170
+ fontWeight: 0,
171
+ alignItems: 'center',
172
+ lineHeight: 'body',
173
+ width: '100%',
174
+ p: astroTokens.spacing.input['md-s'],
175
+ '&:focus-within:not(.is-read-only)': {
176
+ borderColor: 'focus',
177
+ boxShadow: 'none',
178
+ outline: '1px solid',
179
+ outlineColor: 'focus',
180
+ outlineOffset: '0px'
181
+ },
182
+ '&.is-read-only': {
183
+ border: '1px solid',
184
+ borderColor: 'border.input',
185
+ backgroundColor: astroTokens.color.input['readonly-bg'],
186
+ boxShadow: 'none'
187
+ },
188
+ '&.is-disabled': {
189
+ opacity: 1,
190
+ border: '1px solid',
191
+ borderColor: 'border.input',
192
+ backgroundColor: astroTokens.color.gray[100],
193
+ color: 'font.base',
194
+ boxShadow: 'none'
195
+ }
196
+ },
197
+ segment: {
198
+ color: 'font.base',
199
+ fontWeight: 0,
200
+ '&:empty': {
201
+ color: 'font.base'
202
+ }
203
+ }
204
+ };
160
205
  export default {
161
206
  input,
162
207
  label,
@@ -170,5 +215,6 @@ export default {
170
215
  search,
171
216
  switch: switchable,
172
217
  numberField,
173
- timeField
218
+ timeField,
219
+ datePicker
174
220
  };
@@ -665,6 +665,28 @@ const iconButtons = {
665
665
  backgroundColor: astroTokens.color.common.light
666
666
  }
667
667
  }
668
+ },
669
+ datePicker: {
670
+ containedIcon: {
671
+ width: 28,
672
+ height: 28,
673
+ minWidth: 18,
674
+ right: 20,
675
+ px: 0,
676
+ py: 0,
677
+ border: 'none',
678
+ '&.is-disabled': {
679
+ opacity: 1
680
+ },
681
+ '&.is-hovered': {
682
+ backgroundColor: astroTokens.color.gray[100]
683
+ },
684
+ '&.is-pressed': {
685
+ '.material-symbols-outlined': {
686
+ color: 'white'
687
+ }
688
+ }
689
+ }
668
690
  }
669
691
  };
670
692
  const listBoxLink = {
@@ -0,0 +1,166 @@
1
+ import { astroTokens } from '@pingux/onyx-tokens';
2
+ const calendarBody = {
3
+ py: 'sm',
4
+ borderTop: 'none',
5
+ backgroundColor: 'backgroundBase',
6
+ '& > tr:nth-of-type(odd) ': {
7
+ backgroundColor: 'backgroundBase'
8
+ }
9
+ };
10
+ const calendarButton = {
11
+ height: '31px',
12
+ width: '31px',
13
+ margin: '0 auto',
14
+ p: 0,
15
+ fontWeight: '2',
16
+ fontSize: 'small',
17
+ borderRadius: astroTokens.radius.xl,
18
+ color: 'text.primary',
19
+ lineHeight: 1.6,
20
+ justifyContent: 'center',
21
+ '&.is-hovered': {
22
+ bg: astroTokens.color.gray[100],
23
+ color: 'text.primary',
24
+ cursor: 'pointer'
25
+ },
26
+ '&.is-selected': {
27
+ bg: 'active',
28
+ color: 'text.reverse',
29
+ borderRadius: astroTokens.radius.xl,
30
+ outline: 'none',
31
+ boxShadow: 'none'
32
+ },
33
+ '&.is-selection-start': {
34
+ borderRadius: astroTokens.radius.xl
35
+ },
36
+ '&.is-selection-end': {
37
+ borderRadius: astroTokens.radius.xl
38
+ },
39
+ '&.is-start-and-end': {
40
+ borderRadius: astroTokens.radius.xl
41
+ },
42
+ '&.is-focused, &:focus-visible': {
43
+ outline: '2px',
44
+ outlineStyle: 'solid',
45
+ outlineColor: 'focus',
46
+ outlineOffset: '2px'
47
+ },
48
+ '&.is-disabled': {
49
+ backgroundColor: astroTokens.color.gray[300],
50
+ cursor: 'default',
51
+ '&.is-hovered': {
52
+ backgroundColor: astroTokens.color.gray[300]
53
+ }
54
+ },
55
+ '&.is-unavailable': {
56
+ backgroundColor: astroTokens.color.gray[300],
57
+ color: 'text.primary',
58
+ '&.is-hovered': {
59
+ cursor: 'default'
60
+ }
61
+ },
62
+ '&:not(.is-unavailable)&.is-outside-month': {
63
+ backgroundColor: 'unset'
64
+ },
65
+ '&:not(.is-outside-visible-range)&.is-extreme&:not(.is-completely-disabled)': {
66
+ backgroundColor: astroTokens.color.gray[300],
67
+ color: 'text.primary',
68
+ cursor: 'default',
69
+ '&.is-hovered': {
70
+ backgroundColor: astroTokens.color.gray[300]
71
+ }
72
+ }
73
+ };
74
+ const calendarCell = {
75
+ height: '36px',
76
+ width: '40px',
77
+ px: 0,
78
+ color: 'text.primary',
79
+ '&.is-outside-month': {
80
+ opacity: 0.65,
81
+ backgroundColor: 'transparent',
82
+ color: 'text.secondary',
83
+ '& [data-hidden="true"], & > [hidden]': {
84
+ color: 'text.secondary'
85
+ },
86
+ '&.is-completely-disabled': {
87
+ backgroundColor: 'transparent',
88
+ color: 'text.secondary',
89
+ '& > [hidden]': {
90
+ color: 'text.secondary'
91
+ },
92
+ '&.is-hovered': {
93
+ backgroundColor: 'transparent',
94
+ color: 'text.secondary'
95
+ }
96
+ },
97
+ '&.is-unavailable': {
98
+ backgroundColor: astroTokens.color.gray[300],
99
+ color: 'text.primary',
100
+ '& > [hidden]': {
101
+ color: 'text.secondary'
102
+ },
103
+ '&.is-hovered': {
104
+ backgroundColor: astroTokens.color.gray[300],
105
+ color: 'text.primary'
106
+ }
107
+ },
108
+ '&.is-extreme:not(.is-completely-disabled):not(.is-unavailable)': {
109
+ backgroundColor: astroTokens.color.gray[300],
110
+ color: 'text.primary',
111
+ '& > [hidden]': {
112
+ color: 'text.secondary'
113
+ },
114
+ '&.is-hovered': {
115
+ backgroundColor: astroTokens.color.gray[300],
116
+ color: 'text.primary'
117
+ }
118
+ }
119
+ }
120
+ };
121
+ const calendarHeader = {
122
+ justifyContent: 'space-between',
123
+ alignItems: 'center',
124
+ color: 'text.primary'
125
+ };
126
+ const calendarHeaderContainer = {
127
+ mt: 0,
128
+ height: '26px',
129
+ mb: 'md',
130
+ width: '100%'
131
+ };
132
+ const columnHeader = {
133
+ color: 'text.primary',
134
+ fontWeight: 0,
135
+ fontSize: 'small',
136
+ borderBottom: '1px solid',
137
+ borderBottomColor: astroTokens.color.gray[200],
138
+ pb: '32px',
139
+ mb: '0',
140
+ '&.is-disabled': {
141
+ opacity: 0.65
142
+ }
143
+ };
144
+ const calendarContainer = {
145
+ boxShadow: `0 ${astroTokens.spacing.popover.shadow.y}px ${astroTokens.spacing.popover.shadow.blur}px 0 rgba(0, 0, 0, 0.18)`,
146
+ border: '1px solid',
147
+ borderColor: astroTokens.color.common.border,
148
+ borderRadius: astroTokens.radius.xl,
149
+ p: 'md',
150
+ bg: 'backgroundBase',
151
+ color: 'text.primary',
152
+ maxWidth: '312px'
153
+ };
154
+ const calendarRow = {
155
+ bg: 'backgroundBase'
156
+ };
157
+ export default {
158
+ calendarBody,
159
+ calendarButton,
160
+ calendarCell,
161
+ calendarContainer,
162
+ calendarHeader,
163
+ calendarHeaderContainer,
164
+ columnHeader,
165
+ calendarRow
166
+ };
@@ -12,6 +12,7 @@ import arrayField from './arrayField';
12
12
  import { avatar } from './avatar';
13
13
  import { box } from './box';
14
14
  import button, { defaultFocus } from './button';
15
+ import calendar from './calendar';
15
16
  import callout from './callout';
16
17
  import { dataTable } from './dataTable';
17
18
  import environmentBreadcrumb from './environmentBreadcrumb';
@@ -491,6 +492,7 @@ export default {
491
492
  breadcrumb,
492
493
  box,
493
494
  buttonBar,
495
+ calendar,
494
496
  callout,
495
497
  checkboxFieldGroup,
496
498
  codeView,