@headless-adminapp/fluent 1.4.26 → 1.4.28

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.
@@ -4,5 +4,5 @@ import { FC, PropsWithChildren } from 'react';
4
4
  import { ExtendedThemeProps } from '../components/fluent/FluentProvider';
5
5
  export type LayoutProviderProps = Omit<LayoutProviderIntenralProps, 'containers'> & {
6
6
  theme?: PartialTheme;
7
- } & ExtendedThemeProps;
7
+ } & Partial<ExtendedThemeProps>;
8
8
  export declare const LayoutProvider: FC<PropsWithChildren<LayoutProviderProps>>;
@@ -74,7 +74,7 @@ const PageEntityFormDesktopContainer = () => {
74
74
  background: react_components_1.tokens.colorNeutralBackground1,
75
75
  display: 'flex',
76
76
  // overflow: 'hidden',
77
- }, children: (0, jsx_runtime_1.jsx)(CommandContainer_1.CommandContainer, { skeleton: dataState.isFetching }) })), notifications.length > 0 && ((0, jsx_runtime_1.jsx)("div", { children: notifications.map((notification, index) => ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { intent: notification.level, icon: null, children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: notification.message }) }, index))) })), (0, jsx_runtime_1.jsxs)("div", { style: {
77
+ }, children: (0, jsx_runtime_1.jsx)(CommandContainer_1.CommandContainer, { skeleton: dataState.isFetching }) })), notifications.length > 0 && ((0, jsx_runtime_1.jsx)("div", { children: notifications.map((notification, index) => ((0, jsx_runtime_1.jsx)(fluent_1.MessageBar, { intent: notification.level, icon: null, children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: notification.message }) }, index))) })), (0, jsx_runtime_1.jsxs)("div", { style: {
78
78
  display: 'flex',
79
79
  flexDirection: 'column',
80
80
  boxShadow: react_components_1.tokens.shadow4,
@@ -41,7 +41,7 @@ const FormContainer = ({ onClose, onCreate, }) => {
41
41
  gap: react_components_1.tokens.spacingVerticalS,
42
42
  paddingInline: react_components_1.tokens.spacingHorizontalS,
43
43
  paddingTop: react_components_1.tokens.spacingVerticalS,
44
- }, children: notifications.map((notification, index) => ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { intent: notification.level, icon: null, children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: notification.message }) }, index))) }))] }) }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: {
44
+ }, children: notifications.map((notification, index) => ((0, jsx_runtime_1.jsx)(fluent_1.MessageBar, { intent: notification.level, icon: null, children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: notification.message }) }, index))) }))] }) }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: {
45
45
  display: 'flex',
46
46
  flexDirection: 'column',
47
47
  padding: react_components_1.tokens.spacingVerticalM,
@@ -79,7 +79,7 @@ function LoginForm(props) {
79
79
  alignItems: 'stretch',
80
80
  justifyContent: 'flex-start',
81
81
  gap: 16,
82
- }, children: [(0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "username", render: ({ field, fieldState, formState }) => ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Username", labelPosition: "top", required: true, isError: !!fieldState.error?.message && formState.isSubmitted, errorMessage: fieldState.error?.message, children: (0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { placeholder: "Username", appearance: "outline", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, autoCapitalize: "none", autoCorrect: "off", error: !!fieldState.error?.message && formState.isSubmitted }) })) }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "password", render: ({ field, fieldState, formState }) => ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Password", labelPosition: "top", required: true, isError: !!fieldState.error?.message && formState.isSubmitted, errorMessage: fieldState.error?.message, children: (0, jsx_runtime_1.jsx)(PasswordControl_1.PasswordControl, { placeholder: "Password", name: field.name, appearance: "outline", error: !!fieldState.error?.message && formState.isSubmitted, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) })) }), props.beforeLoginContent, !!form.formState.errors.root && ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { intent: "error", children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: form.formState.errors.root.message }) })), (0, jsx_runtime_1.jsxs)(fluent_1.Button, { appearance: "primary", type: "submit", style: {
82
+ }, children: [(0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "username", render: ({ field, fieldState, formState }) => ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Username", labelPosition: "top", required: true, isError: !!fieldState.error?.message && formState.isSubmitted, errorMessage: fieldState.error?.message, children: (0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { placeholder: "Username", appearance: "outline", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, autoCapitalize: "none", autoCorrect: "off", error: !!fieldState.error?.message && formState.isSubmitted }) })) }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "password", render: ({ field, fieldState, formState }) => ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Password", labelPosition: "top", required: true, isError: !!fieldState.error?.message && formState.isSubmitted, errorMessage: fieldState.error?.message, children: (0, jsx_runtime_1.jsx)(PasswordControl_1.PasswordControl, { placeholder: "Password", name: field.name, appearance: "outline", error: !!fieldState.error?.message && formState.isSubmitted, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) })) }), props.beforeLoginContent, !!form.formState.errors.root && ((0, jsx_runtime_1.jsx)(fluent_1.MessageBar, { intent: "error", children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: form.formState.errors.root.message }) })), (0, jsx_runtime_1.jsxs)(fluent_1.Button, { appearance: "primary", type: "submit", style: {
83
83
  marginTop: 8,
84
84
  pointerEvents: form.formState.isSubmitting ? 'none' : 'auto',
85
85
  }, children: [form.formState.isSubmitting && ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny", appearance: "inverted", style: { marginRight: 4 } })), "Login"] }), props.afterLoginContent] }), (0, jsx_runtime_1.jsx)("div", { style: { height: 80 } })] }) }));
@@ -34,5 +34,5 @@ const useStyles = (0, react_components_1.makeStyles)({
34
34
  });
35
35
  exports.Button = (0, react_1.forwardRef)(function Button({ className, ...rest }, ref) {
36
36
  const styles = useStyles();
37
- return ((0, jsx_runtime_1.jsx)(react_components_1.Button, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root, styles[rest.size || 'medium']), "data-icon-only": !rest.children && !!rest.icon ? 'true' : undefined, ref: ref }));
37
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Button, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, styles[rest.size || 'medium'], className), "data-icon-only": !rest.children && !!rest.icon ? 'true' : undefined, ref: ref }));
38
38
  });
@@ -16,7 +16,7 @@ const useStyles = (0, react_components_1.makeStyles)({
16
16
  });
17
17
  exports.Combobox = (0, react_1.forwardRef)(function Combobox({ className, ...rest }, ref) {
18
18
  const styles = useStyles();
19
- return ((0, jsx_runtime_1.jsx)(react_components_1.Combobox, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref, listbox: {
19
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Combobox, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref, listbox: {
20
20
  className: styles.listbox,
21
21
  } }));
22
22
  });
@@ -12,5 +12,5 @@ const useStyles = (0, react_components_1.makeStyles)({
12
12
  });
13
13
  exports.DialogSurface = (0, react_1.forwardRef)(function DialogSurface({ className, ...rest }, ref) {
14
14
  const styles = useStyles();
15
- return ((0, jsx_runtime_1.jsx)(react_components_1.DialogSurface, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
15
+ return ((0, jsx_runtime_1.jsx)(react_components_1.DialogSurface, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
16
16
  });
@@ -34,10 +34,8 @@ const useStyles = (0, react_components_1.makeStyles)({
34
34
  });
35
35
  exports.Dropdown = (0, react_1.forwardRef)(function Dropdown({ className, ...rest }, ref) {
36
36
  const styles = useStyles();
37
- return ((0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root, (rest.appearance === 'outline' || !rest.appearance) && styles.outlined), ref: ref,
38
- // open
39
- // onOpenChange={() => {}}
40
- listbox: {
37
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, (rest.appearance === 'outline' || !rest.appearance) &&
38
+ styles.outlined, className), ref: ref, listbox: {
41
39
  className: styles.listbox,
42
40
  } }));
43
41
  });
@@ -65,6 +65,11 @@ exports.FluentProvider = (0, react_1.forwardRef)(function FluentProvider({ corne
65
65
  let optionPaddingVertical = '6px';
66
66
  let appBarHeight = '48px';
67
67
  let navItempaddingVertical = '10px';
68
+ let calendarTableWidth = '196px';
69
+ let calendarDayCellSize = '24px';
70
+ let calendarHeaderIconSize = '28px';
71
+ let calendarPickerItemButtonSize = '40px';
72
+ let calendarGoTodayButtonHeight = '30px';
68
73
  if (density === 'comfortable') {
69
74
  buttonMinWidthS = '72px';
70
75
  buttonMinWidthM = '112px';
@@ -79,6 +84,11 @@ exports.FluentProvider = (0, react_1.forwardRef)(function FluentProvider({ corne
79
84
  optionPaddingVertical = '9px';
80
85
  appBarHeight = '64px';
81
86
  navItempaddingVertical = '16px';
87
+ calendarTableWidth = '252px';
88
+ calendarDayCellSize = '32px';
89
+ calendarHeaderIconSize = '36px';
90
+ calendarPickerItemButtonSize = '54px';
91
+ calendarGoTodayButtonHeight = '36px';
82
92
  }
83
93
  let fontSizeBase100 = '10px';
84
94
  let fontSizeBase200 = '12px';
@@ -143,6 +153,11 @@ exports.FluentProvider = (0, react_1.forwardRef)(function FluentProvider({ corne
143
153
  optionPaddingVertical,
144
154
  navItempaddingVertical,
145
155
  appBarHeight,
156
+ calendarTableWidth,
157
+ calendarDayCellSize,
158
+ calendarHeaderIconSize,
159
+ calendarPickerItemButtonSize,
160
+ calendarGoTodayButtonHeight,
146
161
  fontSizeBase100,
147
162
  fontSizeBase200,
148
163
  fontSizeBase300,
@@ -39,5 +39,6 @@ const useStyles = (0, react_components_1.makeStyles)({
39
39
  });
40
40
  exports.Input = (0, react_1.forwardRef)(function Input({ className, ...rest }, ref) {
41
41
  const styles = useStyles();
42
- return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root, rest.readOnly && styles.readonly, (rest.appearance === 'outline' || !rest.appearance) && styles.outlined), ref: ref }));
42
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, rest.readOnly && styles.readonly, (rest.appearance === 'outline' || !rest.appearance) &&
43
+ styles.outlined, className), ref: ref }));
43
44
  });
@@ -13,5 +13,5 @@ const useStyles = (0, react_components_1.makeStyles)({
13
13
  });
14
14
  exports.MenuItem = (0, react_1.forwardRef)(function MenuItem({ className, ...rest }, ref) {
15
15
  const styles = useStyles();
16
- return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
16
+ return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
17
17
  });
@@ -13,5 +13,5 @@ const useStyles = (0, react_components_1.makeStyles)({
13
13
  });
14
14
  exports.MenuPopover = (0, react_1.forwardRef)(function MenuPopover({ className, ...rest }, ref) {
15
15
  const styles = useStyles();
16
- return ((0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
16
+ return ((0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
17
17
  });
@@ -0,0 +1,4 @@
1
+ import { ForwardRefComponent, MessageBarProps } from '@fluentui/react-components';
2
+ type ExtendedMessageBarProps = MessageBarProps;
3
+ export declare const MessageBar: ForwardRefComponent<ExtendedMessageBarProps>;
4
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessageBar = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const react_1 = require("react");
7
+ const tokens_1 = require("./tokens");
8
+ const useStyles = (0, react_components_1.makeStyles)({
9
+ root: {
10
+ fontWeight: react_components_1.tokens.fontWeightRegular,
11
+ borderRadius: tokens_1.extendedTokens.controlBorderRadius,
12
+ },
13
+ });
14
+ exports.MessageBar = (0, react_1.forwardRef)(function MessageBar({ className, ...rest }, ref) {
15
+ const styles = useStyles();
16
+ return ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
17
+ });
@@ -8,10 +8,10 @@ const tokens_1 = require("./tokens");
8
8
  const useStyles = (0, react_components_1.makeStyles)({
9
9
  root: {
10
10
  borderRadius: tokens_1.extendedTokens.controlBorderRadius,
11
- paddingBlock: tokens_1.extendedTokens.optionPaddingVertical,
11
+ padding: `${tokens_1.extendedTokens.optionPaddingVertical} ${react_components_1.tokens.spacingHorizontalS}`,
12
12
  },
13
13
  });
14
14
  exports.Option = (0, react_1.forwardRef)(function Option({ className, ...rest }, ref) {
15
15
  const styles = useStyles();
16
- return ((0, jsx_runtime_1.jsx)(react_components_1.Option, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
16
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Option, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
17
17
  });
@@ -12,5 +12,5 @@ const useStyles = (0, react_components_1.makeStyles)({
12
12
  });
13
13
  exports.PopoverSurface = (0, react_1.forwardRef)(function PopoverSurface({ className, ...rest }, ref) {
14
14
  const styles = useStyles();
15
- return ((0, jsx_runtime_1.jsx)(react_components_1.PopoverSurface, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
15
+ return ((0, jsx_runtime_1.jsx)(react_components_1.PopoverSurface, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
16
16
  });
@@ -38,5 +38,5 @@ const useStyles = (0, react_components_1.makeStyles)({
38
38
  });
39
39
  exports.SearchBox = (0, react_1.forwardRef)(function SearchBox({ className, ...rest }, ref) {
40
40
  const styles = useStyles();
41
- return ((0, jsx_runtime_1.jsx)(react_components_1.SearchBox, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root, rest.readOnly && styles.readonly, rest.appearance === 'outline' && styles.outlined), ref: ref }));
41
+ return ((0, jsx_runtime_1.jsx)(react_components_1.SearchBox, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, rest.readOnly && styles.readonly, rest.appearance === 'outline' && styles.outlined, className), ref: ref }));
42
42
  });
@@ -13,5 +13,5 @@ const useStyles = (0, react_components_1.makeStyles)({
13
13
  });
14
14
  exports.SpinButton = (0, react_1.forwardRef)(function SpinButton({ className, ...rest }, ref) {
15
15
  const styles = useStyles();
16
- return ((0, jsx_runtime_1.jsx)(react_components_1.SpinButton, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
16
+ return ((0, jsx_runtime_1.jsx)(react_components_1.SpinButton, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
17
17
  });
@@ -12,5 +12,5 @@ const useStyles = (0, react_components_1.makeStyles)({
12
12
  });
13
13
  exports.Tag = (0, react_1.forwardRef)(function Tag({ className, ...rest }, ref) {
14
14
  const styles = useStyles();
15
- return ((0, jsx_runtime_1.jsx)(react_components_1.Tag, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), ref: ref }));
15
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Tag, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), ref: ref }));
16
16
  });
@@ -26,5 +26,5 @@ const useStyles = (0, react_components_1.makeStyles)({
26
26
  });
27
27
  exports.Textarea = (0, react_1.forwardRef)(function Textarea({ className, ...rest }, ref) {
28
28
  const styles = useStyles();
29
- return ((0, jsx_runtime_1.jsx)(react_components_1.Textarea, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root, rest.readOnly && styles.readonly), ref: ref }));
29
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Textarea, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, rest.readOnly && styles.readonly, className), ref: ref }));
30
30
  });
@@ -18,5 +18,5 @@ const useStyles = (0, react_components_1.makeStyles)({
18
18
  });
19
19
  exports.ToolbarButton = (0, react_1.forwardRef)(function ToolbarButton({ className, ...rest }, ref) {
20
20
  const styles = useStyles();
21
- return ((0, jsx_runtime_1.jsx)(react_components_1.ToolbarButton, { ...rest, className: (0, react_components_1.mergeClasses)(className, styles.root), "data-icon-only": !rest.children && !!rest.icon ? 'true' : undefined, ref: ref }));
21
+ return ((0, jsx_runtime_1.jsx)(react_components_1.ToolbarButton, { ...rest, className: (0, react_components_1.mergeClasses)(styles.root, className), "data-icon-only": !rest.children && !!rest.icon ? 'true' : undefined, ref: ref }));
22
22
  });
@@ -15,3 +15,4 @@ export { Checkbox } from './Checkbox';
15
15
  export { MenuItem } from './MenuItem';
16
16
  export { PopoverSurface } from './PopoverSurface';
17
17
  export { DialogSurface } from './DialogSurface';
18
+ export { MessageBar } from './MessageBar';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DialogSurface = exports.PopoverSurface = exports.MenuItem = exports.Checkbox = exports.Option = exports.tokens = exports.extendedTokens = exports.FluentProvider = exports.SearchBox = exports.MenuPopover = exports.ToolbarButton = exports.SpinButton = exports.Dropdown = exports.Tag = exports.Combobox = exports.Textarea = exports.Input = exports.Button = void 0;
3
+ exports.MessageBar = exports.DialogSurface = exports.PopoverSurface = exports.MenuItem = exports.Checkbox = exports.Option = exports.tokens = exports.extendedTokens = exports.FluentProvider = exports.SearchBox = exports.MenuPopover = exports.ToolbarButton = exports.SpinButton = exports.Dropdown = exports.Tag = exports.Combobox = exports.Textarea = exports.Input = exports.Button = void 0;
4
4
  var Button_1 = require("./Button");
5
5
  Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
6
6
  var Input_1 = require("./Input");
@@ -36,3 +36,5 @@ var PopoverSurface_1 = require("./PopoverSurface");
36
36
  Object.defineProperty(exports, "PopoverSurface", { enumerable: true, get: function () { return PopoverSurface_1.PopoverSurface; } });
37
37
  var DialogSurface_1 = require("./DialogSurface");
38
38
  Object.defineProperty(exports, "DialogSurface", { enumerable: true, get: function () { return DialogSurface_1.DialogSurface; } });
39
+ var MessageBar_1 = require("./MessageBar");
40
+ Object.defineProperty(exports, "MessageBar", { enumerable: true, get: function () { return MessageBar_1.MessageBar; } });
@@ -24,6 +24,11 @@ export type ExtendedTokens = {
24
24
  optionPaddingVertical: string;
25
25
  appBarHeight: string;
26
26
  navItempaddingVertical: string;
27
+ calendarTableWidth: string;
28
+ calendarDayCellSize: string;
29
+ calendarHeaderIconSize: string;
30
+ calendarPickerItemButtonSize: string;
31
+ calendarGoTodayButtonHeight: string;
27
32
  };
28
33
  export { tokens } from '@fluentui/react-components';
29
34
  export declare const extendedTokens: ExtendedTokens;
@@ -29,4 +29,9 @@ exports.extendedTokens = {
29
29
  optionPaddingVertical: 'var(--optionPaddingVertical)',
30
30
  appBarHeight: 'var(--appBarHeight)',
31
31
  navItempaddingVertical: 'var(--navItempaddingVertical)',
32
+ calendarTableWidth: 'var(--calendarTableWidth)',
33
+ calendarDayCellSize: 'var(--calendarDayCellSize)',
34
+ calendarHeaderIconSize: 'var(--calendarHeaderIconSize)',
35
+ calendarPickerItemButtonSize: 'var(--calendarPickerItemButtonSize)',
36
+ calendarGoTodayButtonHeight: 'var(--calendarGoTodayButtonHeight)',
32
37
  };
@@ -1,4 +1,5 @@
1
1
  import { ControlProps } from './types';
2
+ export declare const useCalendarStyles: () => Record<"calendar", string>;
2
3
  export interface DateControlProps extends ControlProps<string> {
3
4
  maxDate?: Date;
4
5
  minDate?: Date;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useCalendarStyles = void 0;
6
7
  exports.DateControl = DateControl;
7
8
  const jsx_runtime_1 = require("react/jsx-runtime");
8
9
  const react_calendar_compat_1 = require("@fluentui/react-calendar-compat");
@@ -18,9 +19,48 @@ const fluent_1 = require("../../components/fluent");
18
19
  const SkeletonControl_1 = require("./SkeletonControl");
19
20
  dayjs_1.default.extend(utc_1.default);
20
21
  dayjs_1.default.extend(timezone_1.default);
22
+ exports.useCalendarStyles = (0, react_components_1.makeStyles)({
23
+ calendar: {
24
+ width: `calc(${fluent_1.extendedTokens.calendarTableWidth} + 24px)`,
25
+ '& .fui-CalendarDay': {
26
+ width: fluent_1.extendedTokens.calendarTableWidth,
27
+ },
28
+ '& .fui-CalendarDayGrid__table': {
29
+ width: fluent_1.extendedTokens.calendarTableWidth,
30
+ },
31
+ '& .fui-CalendarDayGrid__dayButton': {
32
+ width: fluent_1.extendedTokens.calendarDayCellSize,
33
+ height: fluent_1.extendedTokens.calendarDayCellSize,
34
+ lineHeight: fluent_1.extendedTokens.calendarDayCellSize,
35
+ },
36
+ '& .fui-CalendarDay__headerIconButton': {
37
+ width: fluent_1.extendedTokens.calendarHeaderIconSize,
38
+ height: fluent_1.extendedTokens.calendarHeaderIconSize,
39
+ lineHeight: fluent_1.extendedTokens.calendarHeaderIconSize,
40
+ },
41
+ '& .fui-CalendarPicker__navigationButton': {
42
+ width: fluent_1.extendedTokens.calendarHeaderIconSize,
43
+ height: fluent_1.extendedTokens.calendarHeaderIconSize,
44
+ lineHeight: fluent_1.extendedTokens.calendarHeaderIconSize,
45
+ },
46
+ '& .fui-CalendarPicker__itemButton': {
47
+ width: fluent_1.extendedTokens.calendarPickerItemButtonSize,
48
+ height: fluent_1.extendedTokens.calendarPickerItemButtonSize,
49
+ lineHeight: fluent_1.extendedTokens.calendarPickerItemButtonSize,
50
+ },
51
+ '& .fui-CalendarPicker': {
52
+ width: fluent_1.extendedTokens.calendarTableWidth,
53
+ },
54
+ '& .fui-Calendar__goTodayButton': {
55
+ height: fluent_1.extendedTokens.calendarGoTodayButtonHeight,
56
+ lineHeight: fluent_1.extendedTokens.calendarGoTodayButtonHeight,
57
+ },
58
+ },
59
+ });
21
60
  function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, skeleton, }) {
22
61
  const { dateFormats } = (0, locale_1.useLocale)();
23
62
  const { datePickerStrings } = (0, AppStringContext_1.useAppStrings)();
63
+ const calendarStyles = (0, exports.useCalendarStyles)();
24
64
  if (skeleton) {
25
65
  return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
26
66
  }
@@ -44,5 +84,7 @@ function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder,
44
84
  justifyContent: 'center',
45
85
  marginRight: -4,
46
86
  color: react_components_1.tokens.colorNeutralForeground2,
47
- }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Calendar, { size: 20 }) }) }));
87
+ }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Calendar, { size: 20 }) }), calendar: {
88
+ className: calendarStyles.calendar,
89
+ } }));
48
90
  }
@@ -16,12 +16,16 @@ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
16
16
  const utc_1 = __importDefault(require("dayjs/plugin/utc"));
17
17
  const react_1 = require("react");
18
18
  const fluent_1 = require("../../components/fluent");
19
+ const DateControl_1 = require("./DateControl");
19
20
  const SkeletonControl_1 = require("./SkeletonControl");
21
+ const TimeControl_1 = require("./TimeControl/TimeControl");
20
22
  const utils_1 = require("./TimeControl/utils");
21
23
  dayjs_1.default.extend(customParseFormat_1.default);
22
24
  dayjs_1.default.extend(utc_1.default);
23
25
  dayjs_1.default.extend(timezone_1.default);
24
26
  function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, skeleton, }) {
27
+ const calendarStyles = (0, DateControl_1.useCalendarStyles)();
28
+ const timePickerStyles = (0, TimeControl_1.useTimePickerStyles)();
25
29
  const { dateFormats: { short: dateFormat }, timeFormats: { short: timeFormat }, timezone, } = (0, locale_1.useLocale)();
26
30
  const [internalTimeValue, setInternalTimeValue] = (0, react_1.useState)(value ? (0, dayjs_1.default)(value).tz(timezone).format(timeFormat) : '');
27
31
  const internalTimeValueRef = (0, react_1.useRef)(internalTimeValue);
@@ -90,6 +94,8 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
90
94
  style: {
91
95
  borderRadius: fluent_1.extendedTokens.paperBorderRadius,
92
96
  },
97
+ }, calendar: {
98
+ className: calendarStyles.calendar,
93
99
  } }), (0, jsx_runtime_1.jsx)(react_timepicker_compat_1.TimePicker, { appearance: "filled-darker", style: {
94
100
  flex: 1,
95
101
  minWidth: 0,
@@ -144,8 +150,6 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
144
150
  marginRight: -4,
145
151
  color: react_components_1.tokens.colorNeutralForeground2,
146
152
  }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Clock, { size: 20 }) }), listbox: {
147
- style: {
148
- borderRadius: fluent_1.extendedTokens.paperBorderRadius,
149
- },
153
+ className: timePickerStyles.listbox,
150
154
  } })] }));
151
155
  }
@@ -1,4 +1,5 @@
1
1
  import { ControlProps } from '../types';
2
+ export declare const useTimePickerStyles: () => Record<"listbox", string>;
2
3
  export interface TimeControlProps extends ControlProps<number> {
3
4
  }
4
5
  export declare function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled, readOnly, skeleton, }: Readonly<TimeControlProps>): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useTimePickerStyles = void 0;
6
7
  exports.TimeControl = TimeControl;
7
8
  const jsx_runtime_1 = require("react/jsx-runtime");
8
9
  const react_components_1 = require("@fluentui/react-components");
@@ -16,7 +17,17 @@ const fluent_1 = require("../../../components/fluent");
16
17
  const SkeletonControl_1 = require("../SkeletonControl");
17
18
  const utils_1 = require("./utils");
18
19
  dayjs_1.default.extend(customParseFormat_1.default);
20
+ exports.useTimePickerStyles = (0, react_components_1.makeStyles)({
21
+ listbox: {
22
+ borderRadius: fluent_1.extendedTokens.paperBorderRadius,
23
+ '& .fui-Option': {
24
+ borderRadius: fluent_1.extendedTokens.controlBorderRadius,
25
+ padding: `${fluent_1.extendedTokens.optionPaddingVertical} ${react_components_1.tokens.spacingHorizontalS}`,
26
+ },
27
+ },
28
+ });
19
29
  function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled, readOnly, skeleton, }) {
30
+ const timePickerStyles = (0, exports.useTimePickerStyles)();
20
31
  const { timeFormats: { short: timeFormat }, timezone, } = (0, locale_1.useLocale)();
21
32
  const [internalTimeValue, setInternalTimeValue] = (0, react_1.useState)(value ? (0, dayjs_1.default)().startOf('day').add(value, 'minutes').format(timeFormat) : '');
22
33
  const internalTimeValueRef = (0, react_1.useRef)(internalTimeValue);
@@ -82,8 +93,6 @@ function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled,
82
93
  marginRight: -4,
83
94
  color: react_components_1.tokens.colorNeutralForeground2,
84
95
  }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Clock, { size: 20 }) }), listbox: {
85
- style: {
86
- borderRadius: fluent_1.extendedTokens.paperBorderRadius,
87
- },
96
+ className: timePickerStyles.listbox,
88
97
  } }) }));
89
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "1.4.26",
3
+ "version": "1.4.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -54,5 +54,5 @@
54
54
  "devDependencies": {
55
55
  "@types/lodash": "4.17.20"
56
56
  },
57
- "gitHead": "086994cfa783e4228290a2108dc84e057dbb00fb"
57
+ "gitHead": "97f2ca3d52879bfff96af530fcc1336989f2fb09"
58
58
  }