@react-md/core 1.0.0-next.1 → 1.0.0-next.2
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/DefaultToastRenderer.tsx.html +166 -112
- package/coverage/lcov-report/Snackbar.tsx.html +360 -402
- package/coverage/lcov-report/Toast.tsx.html +868 -0
- package/coverage/lcov-report/ToastManager.tsx.html +1783 -0
- package/coverage/lcov-report/ToastManagerProvider.tsx.html +216 -216
- package/coverage/lcov-report/icon/FontIcon.tsx.html +28 -28
- package/coverage/lcov-report/icon/index.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/snackbar/Snackbar.tsx.html +55 -97
- package/coverage/lcov-report/snackbar/Toast.tsx.html +546 -501
- package/coverage/lcov-report/snackbar/ToastManager.tsx.html +269 -269
- package/coverage/lcov-report/snackbar/ToastManagerProvider.tsx.html +23 -23
- package/coverage/lcov-report/snackbar/index.html +59 -14
- package/coverage/lcov-report/snackbar/snackbarStyles.ts.html +12 -87
- package/coverage/lcov-report/snackbar/toastStyles.ts.html +206 -146
- package/coverage/lcov-report/snackbar/useCurrentToastActions.ts.html +226 -0
- package/coverage/lcov-report/snackbarStyles.ts.html +46 -121
- package/coverage/lcov-report/transition/config.ts.html +5 -5
- package/coverage/lcov-report/transition/index.html +1 -1
- package/coverage/lcov-report/typography/Typography.tsx.html +108 -402
- package/coverage/lcov-report/typography/index.html +10 -10
- package/dist/_core.scss +34 -1
- package/dist/_utils.scss +57 -0
- package/dist/app-bar/_app-bar.scss +15 -23
- package/dist/avatar/_avatar.scss +25 -34
- package/dist/badge/_badge.scss +71 -44
- package/dist/box/_box.scss +18 -29
- package/dist/button/_button.scss +50 -62
- package/dist/card/_card.scss +14 -23
- package/dist/chip/_chip.scss +33 -46
- package/dist/dialog/_dialog.scss +95 -93
- package/dist/divider/Divider.d.ts +0 -1
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/_divider.scss +33 -43
- package/dist/form/Label.d.ts +5 -5
- package/dist/form/Label.js.map +1 -1
- package/dist/form/TextArea.js +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextFieldContainerStyles.d.ts +7 -7
- package/dist/form/TextFieldContainerStyles.js.map +1 -1
- package/dist/form/_form.scss +200 -203
- package/dist/form/textAreaStyles.d.ts +2 -2
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/types.d.ts +0 -2
- package/dist/form/types.js.map +1 -1
- package/dist/icon/_icon.scss +31 -47
- package/dist/interaction/_interaction.scss +47 -57
- package/dist/layout/_layout.scss +14 -19
- package/dist/link/_link.scss +15 -23
- package/dist/list/_list.scss +53 -63
- package/dist/menu/_menu.scss +16 -27
- package/dist/overlay/_overlay.scss +14 -19
- package/dist/progress/_progress.scss +25 -30
- package/dist/segmented-button/_segmented-button.scss +32 -43
- package/dist/sheet/_sheet.scss +24 -42
- package/dist/snackbar/DefaultToastRenderer.js +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +1 -3
- package/dist/snackbar/Snackbar.js +2 -3
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +1 -1
- package/dist/snackbar/Toast.js +5 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastManager.d.ts +2 -1
- package/dist/snackbar/ToastManager.js +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/_snackbar.scss +15 -23
- package/dist/table/_table.scss +55 -70
- package/dist/tabs/_tabs.scss +25 -30
- package/dist/theme/_theme.scss +31 -89
- package/dist/tooltip/_tooltip.scss +16 -25
- package/dist/transition/_transition.scss +38 -37
- package/dist/tree/_tree.scss +102 -109
- package/dist/typography/_typography.scss +17 -22
- package/dist/window-splitter/_window-splitter.scss +19 -45
- package/package.json +1 -1
- package/src/_core.scss +34 -1
- package/src/_utils.scss +57 -0
- package/src/app-bar/_app-bar.scss +15 -23
- package/src/avatar/_avatar.scss +25 -34
- package/src/badge/_badge.scss +71 -44
- package/src/box/_box.scss +18 -29
- package/src/button/_button.scss +50 -62
- package/src/card/_card.scss +14 -23
- package/src/chip/_chip.scss +33 -46
- package/src/dialog/_dialog.scss +95 -93
- package/src/divider/Divider.tsx +0 -1
- package/src/divider/_divider.scss +33 -43
- package/src/form/Label.tsx +5 -5
- package/src/form/TextArea.tsx +1 -1
- package/src/form/TextFieldContainerStyles.ts +7 -7
- package/src/form/_form.scss +200 -203
- package/src/form/textAreaStyles.ts +2 -2
- package/src/form/types.ts +0 -2
- package/src/icon/_icon.scss +31 -47
- package/src/interaction/_interaction.scss +47 -57
- package/src/layout/_layout.scss +14 -19
- package/src/link/_link.scss +15 -23
- package/src/list/_list.scss +53 -63
- package/src/menu/_menu.scss +16 -27
- package/src/overlay/_overlay.scss +14 -19
- package/src/progress/_progress.scss +25 -30
- package/src/segmented-button/_segmented-button.scss +32 -43
- package/src/sheet/_sheet.scss +24 -42
- package/src/snackbar/DefaultToastRenderer.tsx +1 -1
- package/src/snackbar/Snackbar.tsx +17 -25
- package/src/snackbar/Toast.tsx +7 -2
- package/src/snackbar/ToastManager.tsx +3 -2
- package/src/snackbar/__tests__/Snackbar.tsx +12 -11
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +20 -42
- package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +127 -27
- package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +23 -8
- package/src/snackbar/_snackbar.scss +15 -23
- package/src/table/_table.scss +55 -70
- package/src/tabs/_tabs.scss +25 -30
- package/src/theme/_theme.scss +31 -89
- package/src/tooltip/_tooltip.scss +16 -25
- package/src/transition/_transition.scss +38 -37
- package/src/tree/_tree.scss +102 -109
- package/src/typography/_typography.scss +17 -22
- package/src/window-splitter/_window-splitter.scss +19 -45
- package/.turbo/turbo-lint.log +0 -12
- package/.turbo/turbo-test.log +0 -166
- package/.turbo/turbo-typecheck.log +0 -4
- package/dist/divider/VerticalDivider.d.ts +0 -32
- package/dist/divider/useVerticalDividerHeight.d.ts +0 -37
- package/dist/icon/MaterialIconsProvider.d.ts +0 -12
- package/dist/icon/MaterialIconsProvider.js +0 -17
- package/dist/icon/MaterialIconsProvider.js.map +0 -1
- package/dist/icon/MaterialSymbolsProvider.d.ts +0 -145
- package/dist/icon/MaterialSymbolsProvider.js +0 -60
- package/dist/icon/MaterialSymbolsProvider.js.map +0 -1
- package/dist/link/LinkProvider.d.ts +0 -29
- package/dist/menu/menuConfig.d.ts +0 -60
- package/dist/tooltip/useOverflowTooltip.d.ts +0 -61
|
@@ -2,8 +2,8 @@ import { type TextFieldClassNameOptions } from "./textFieldStyles.js";
|
|
|
2
2
|
import { type TextAreaResize } from "./useResizingTextArea.js";
|
|
3
3
|
declare module "react" {
|
|
4
4
|
interface CSSProperties {
|
|
5
|
-
"--rmd-
|
|
6
|
-
"--rmd-
|
|
5
|
+
"--rmd-textarea-height"?: string | number;
|
|
6
|
+
"--rmd-textarea-padding"?: string | number;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/textAreaStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport {\n textField,\n type TextFieldClassNameOptions,\n} from \"./textFieldStyles.js\";\nimport { type TextAreaResize } from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-
|
|
1
|
+
{"version":3,"sources":["../../src/form/textAreaStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\nimport {\n textField,\n type TextFieldClassNameOptions,\n} from \"./textFieldStyles.js\";\nimport { type TextAreaResize } from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-textarea-height\"?: string | number;\n \"--rmd-textarea-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-textarea\");\nconst containerStyles = bem(\"rmd-textarea-container\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TextareaClassNameOptions extends TextFieldClassNameOptions {\n className?: string;\n\n /**\n * This should not be used externally and is only used for creating the hidden\n * textarea mask for the auto resizing behavior.\n *\n * @defaultValue `false`\n */\n mask?: boolean;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * Set this to `true` if the textarea should display a scrollbar.\n *\n * @defaultValue `false`\n */\n scrollable?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function textArea(options: TextareaClassNameOptions = {}): string {\n const {\n className,\n mask,\n resize = \"auto\",\n scrollable,\n placeholderHidden,\n } = options;\n\n return cnb(\n textField({ placeholderHidden }),\n styles({\n rh: resize === \"horizontal\",\n rv: resize === \"vertical\",\n rn: resize === \"auto\" || resize === \"none\",\n mask,\n scrollable: scrollable || resize === \"none\",\n }),\n className\n );\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TextareaContainerClassNameOptions {\n className?: string;\n height?: boolean;\n disabled?: boolean;\n animate?: boolean;\n underlineLabelled?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function textAreaContainer(\n options: TextareaContainerClassNameOptions = {}\n): string {\n const { className, height, animate, disabled, underlineLabelled } = options;\n\n return cnb(\n containerStyles({\n height,\n animate,\n cursor: !disabled,\n \"underline-labelled\": underlineLabelled,\n }),\n className\n );\n}\n"],"names":["cnb","bem","textField","styles","containerStyles","textArea","options","className","mask","resize","scrollable","placeholderHidden","rh","rv","rn","textAreaContainer","height","animate","disabled","underlineLabelled","cursor"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SACEC,SAAS,QAEJ,uBAAuB;AAU9B,MAAMC,SAASF,IAAI;AACnB,MAAMG,kBAAkBH,IAAI;AA8B5B;;CAEC,GACD,OAAO,SAASI,SAASC,UAAoC,CAAC,CAAC;IAC7D,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,SAAS,MAAM,EACfC,UAAU,EACVC,iBAAiB,EAClB,GAAGL;IAEJ,OAAON,IACLE,UAAU;QAAES;IAAkB,IAC9BR,OAAO;QACLS,IAAIH,WAAW;QACfI,IAAIJ,WAAW;QACfK,IAAIL,WAAW,UAAUA,WAAW;QACpCD;QACAE,YAAYA,cAAcD,WAAW;IACvC,IACAF;AAEJ;AAaA;;CAEC,GACD,OAAO,SAASQ,kBACdT,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAAEC,SAAS,EAAES,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGb;IAEpE,OAAON,IACLI,gBAAgB;QACdY;QACAC;QACAG,QAAQ,CAACF;QACT,sBAAsBC;IACxB,IACAZ;AAEJ"}
|
package/dist/form/types.d.ts
CHANGED
|
@@ -2,10 +2,8 @@ import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes, type
|
|
|
2
2
|
import { type PropsWithRef } from "../types.js";
|
|
3
3
|
declare module "react" {
|
|
4
4
|
interface CSSProperties {
|
|
5
|
-
"--rmd-form-error-color"?: string;
|
|
6
5
|
"--rmd-form-active-color"?: string;
|
|
7
6
|
"--rmd-form-focus-color"?: string;
|
|
8
|
-
"--rmd-form-disabled-color"?: string;
|
|
9
7
|
}
|
|
10
8
|
}
|
|
11
9
|
/**
|
package/dist/form/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-error-color\"?: string;\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n \"--rmd-form-disabled-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutoCompleteValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface UserAgentAutoCompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutoCompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutoCompleteValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutoCompleteProps.name}\n */\n autoCompleteValue?: AutoCompleteValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @remarks \\@since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>,\n HTMLDivElement\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0 Added support for `leftAddonProps` and\n * `rightAddonProps`.\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * Set this to `true` if this component should stretch to fill a flex or grid\n * container using `flex: 1 1 auto`.\n *\n * @defaultValue `false`\n */\n stretch?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @remarks \\@since 6.0.0\n */\n leftAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @remarks \\@since 6.0.0\n */\n rightAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"mappings":"AAmhBA,WAmDC"}
|
|
1
|
+
{"version":3,"sources":["../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutoCompleteValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface UserAgentAutoCompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutoCompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutoCompleteValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutoCompleteProps.name}\n */\n autoCompleteValue?: AutoCompleteValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @remarks \\@since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>,\n HTMLDivElement\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0 Added support for `leftAddonProps` and\n * `rightAddonProps`.\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * Set this to `true` if this component should stretch to fill a flex or grid\n * container using `flex: 1 1 auto`.\n *\n * @defaultValue `false`\n */\n stretch?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @remarks \\@since 6.0.0\n */\n leftAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @remarks \\@since 6.0.0\n */\n rightAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"mappings":"AAihBA,WAmDC"}
|
package/dist/icon/_icon.scss
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@use "sass:color";
|
|
2
|
-
@use "sass:map";
|
|
3
2
|
@use "../theme/theme";
|
|
4
3
|
@use "../transition/transition";
|
|
5
4
|
@use "../utils";
|
|
@@ -47,61 +46,31 @@ $rotate-from: 0deg !default;
|
|
|
47
46
|
$rotate-to: 180deg !default;
|
|
48
47
|
$rotate-duration: transition.$linear-duration !default;
|
|
49
48
|
|
|
50
|
-
$
|
|
51
|
-
color
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var: --rmd-icon-spacing,
|
|
61
|
-
value: $spacing,
|
|
62
|
-
),
|
|
63
|
-
rotate-from: (
|
|
64
|
-
var: --rmd-icon-rotate-from,
|
|
65
|
-
value: $rotate-from,
|
|
66
|
-
),
|
|
67
|
-
rotate-to: (
|
|
68
|
-
var: --rmd-icon-rotate-to,
|
|
69
|
-
value: $rotate-to,
|
|
70
|
-
),
|
|
71
|
-
symbol-fill: (
|
|
72
|
-
var: --rmd-symbol-fill,
|
|
73
|
-
value: $symbol-fill,
|
|
74
|
-
),
|
|
75
|
-
symbol-grade: (
|
|
76
|
-
var: --rmd-symbol-grad,
|
|
77
|
-
value: $symbol-grade,
|
|
78
|
-
),
|
|
79
|
-
symbol-weight: (
|
|
80
|
-
var: --rmd-symbol-wght,
|
|
81
|
-
value: $symbol-weight,
|
|
82
|
-
),
|
|
83
|
-
symbol-optical-size: (
|
|
84
|
-
var: --rmd-symbol-opsz,
|
|
85
|
-
value: $symbol-optical-size,
|
|
86
|
-
),
|
|
49
|
+
$variables: (
|
|
50
|
+
color,
|
|
51
|
+
size,
|
|
52
|
+
spacing,
|
|
53
|
+
rotate-from,
|
|
54
|
+
rotate-to,
|
|
55
|
+
symbol-fill,
|
|
56
|
+
symbol-grade,
|
|
57
|
+
symbol-weight,
|
|
58
|
+
symbol-optical-size
|
|
87
59
|
);
|
|
88
60
|
|
|
89
61
|
@function get-var($name, $fallback: null) {
|
|
90
|
-
$
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
@if $value {
|
|
95
|
-
@return var(#{$var}, #{$value});
|
|
62
|
+
$var: utils.get-var-name($variables, $name, "icon");
|
|
63
|
+
@if $fallback {
|
|
64
|
+
@return var(#{$var}, #{$fallback});
|
|
96
65
|
}
|
|
97
66
|
|
|
98
67
|
@return var(#{$var});
|
|
99
68
|
}
|
|
100
69
|
|
|
101
70
|
@mixin set-var($name, $value) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
71
|
+
@if $value {
|
|
72
|
+
#{utils.get-var-name($variables, $name, "icon")}: #{$value};
|
|
73
|
+
}
|
|
105
74
|
}
|
|
106
75
|
|
|
107
76
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
@@ -126,6 +95,21 @@ $var-lookup: (
|
|
|
126
95
|
}
|
|
127
96
|
}
|
|
128
97
|
|
|
98
|
+
@mixin variables {
|
|
99
|
+
@if not $disable-font or not $disable-svg or not $disable-symbol {
|
|
100
|
+
@include set-var(color, $color);
|
|
101
|
+
@include set-var(size, $size);
|
|
102
|
+
@include set-var(spacing, $spacing);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@if not $disable-symbol {
|
|
106
|
+
@include set-var(symbol-fill, $symbol-fill);
|
|
107
|
+
@include set-var(symbol-grade, $symbol-grade);
|
|
108
|
+
@include set-var(symbol-weight, $symbol-weight);
|
|
109
|
+
@include set-var(symbol-optical-size, $symbol-optical-size);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
129
113
|
@mixin styles {
|
|
130
114
|
// shouldn't really use react-md without icons though...
|
|
131
115
|
@if not $disable-font or not $disable-svg and not $disable-symbol {
|
|
@@ -117,55 +117,19 @@ $selected-background-color: theme.get-default-color(
|
|
|
117
117
|
$dark-surface-selected-background-color
|
|
118
118
|
) !default;
|
|
119
119
|
|
|
120
|
-
$
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
background-color
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
focus-background-color: (
|
|
134
|
-
var: --rmd-focus-background-color,
|
|
135
|
-
value: $focus-background-color,
|
|
136
|
-
),
|
|
137
|
-
press-background-color: (
|
|
138
|
-
var: --rmd-press-background-color,
|
|
139
|
-
value: $press-background-color,
|
|
140
|
-
),
|
|
141
|
-
selected-background-color: (
|
|
142
|
-
var: --rmd-selected-background-color,
|
|
143
|
-
value: $selected-background-color,
|
|
144
|
-
),
|
|
145
|
-
focus-color: (
|
|
146
|
-
var: --rmd-focus-color,
|
|
147
|
-
value: $focus-color,
|
|
148
|
-
),
|
|
149
|
-
focus-width: (
|
|
150
|
-
var: --rmd-focus-width,
|
|
151
|
-
value: $focus-width,
|
|
152
|
-
),
|
|
153
|
-
ripple-inset: (
|
|
154
|
-
var: --rmd-ripple-inset,
|
|
155
|
-
value: 0,
|
|
156
|
-
),
|
|
157
|
-
ripple-border-radius: (
|
|
158
|
-
var: --rmd-ripple-border-radius,
|
|
159
|
-
value: inherit,
|
|
160
|
-
),
|
|
161
|
-
surface-inset: (
|
|
162
|
-
var: --rmd-surface-inset,
|
|
163
|
-
value: 0,
|
|
164
|
-
),
|
|
165
|
-
surface-border-radius: (
|
|
166
|
-
var: --rmd-surface-border-radius,
|
|
167
|
-
value: inherit,
|
|
168
|
-
),
|
|
120
|
+
$variables: (
|
|
121
|
+
background-color,
|
|
122
|
+
hover-background-color,
|
|
123
|
+
focus-background-color,
|
|
124
|
+
press-background-color,
|
|
125
|
+
selected-background-color,
|
|
126
|
+
focus-color,
|
|
127
|
+
focus-width,
|
|
128
|
+
ripple-inset,
|
|
129
|
+
ripple-border-radius,
|
|
130
|
+
ripple-background-color,
|
|
131
|
+
surface-inset,
|
|
132
|
+
surface-border-radius
|
|
169
133
|
);
|
|
170
134
|
|
|
171
135
|
@function _is-var-disabled($name) {
|
|
@@ -189,27 +153,35 @@ $var-lookup: (
|
|
|
189
153
|
}
|
|
190
154
|
|
|
191
155
|
@function get-var($name, $fallback: null) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
156
|
+
// cannot set a custom property to `inherit` for some reason. It will not be parsed.
|
|
157
|
+
@if not
|
|
158
|
+
$fallback and
|
|
159
|
+
($name == ripple-border-radius or $name == surface-border-radius)
|
|
160
|
+
{
|
|
161
|
+
$fallback: inherit;
|
|
162
|
+
}
|
|
163
|
+
|
|
195
164
|
@if _is-var-disabled($name) {
|
|
196
|
-
@return $
|
|
165
|
+
@return $fallback;
|
|
197
166
|
}
|
|
198
167
|
|
|
199
|
-
|
|
200
|
-
|
|
168
|
+
$var: utils.get-var-name($variables, $name, "interaction");
|
|
169
|
+
|
|
170
|
+
@if $fallback {
|
|
171
|
+
@return var(#{$var}, #{$fallback});
|
|
201
172
|
}
|
|
202
173
|
|
|
203
174
|
@return var(#{$var});
|
|
204
175
|
}
|
|
205
176
|
|
|
206
177
|
@mixin set-var($name, $value) {
|
|
207
|
-
$var: map.get(utils.validate($var-lookup, $name, "interaction var"), var);
|
|
208
178
|
@if _is-var-disabled($name) {
|
|
209
179
|
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}-var" to `true` or remove it from the Sass module overrides.';
|
|
210
180
|
}
|
|
211
181
|
|
|
212
|
-
|
|
182
|
+
@if $value {
|
|
183
|
+
#{utils.get-var-name($variables, $name, "interaction")}: #{$value};
|
|
184
|
+
}
|
|
213
185
|
}
|
|
214
186
|
|
|
215
187
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
@@ -382,6 +354,24 @@ $var-lookup: (
|
|
|
382
354
|
}
|
|
383
355
|
}
|
|
384
356
|
|
|
357
|
+
@mixin variables {
|
|
358
|
+
@include set-var(focus-color, $focus-color);
|
|
359
|
+
@include set-var(focus-width, $focus-width);
|
|
360
|
+
@include set-var(hover-background-color, $hover-background-color);
|
|
361
|
+
@include set-var(focus-background-color, $focus-background-color);
|
|
362
|
+
@include set-var(press-background-color, $press-background-color);
|
|
363
|
+
@include set-var(selected-background-color, $selected-background-color);
|
|
364
|
+
|
|
365
|
+
@if not $_disable-ripple {
|
|
366
|
+
@include set-var(ripple-background-color, $ripple-background-color);
|
|
367
|
+
@include set-var(ripple-inset, 0);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
@if not $disable-surface-inset-var {
|
|
371
|
+
@include set-var(surface-inset, 0);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
385
375
|
@mixin styles {
|
|
386
376
|
@if not $_disable-ripple {
|
|
387
377
|
.rmd-ripple-container {
|
package/dist/layout/_layout.scss
CHANGED
|
@@ -29,39 +29,34 @@ $enter-timing-function: sheet.$enter-timing-function !default;
|
|
|
29
29
|
$leave-duration: sheet.$leave-duration !default;
|
|
30
30
|
$leave-timing-function: sheet.$leave-timing-function !default;
|
|
31
31
|
|
|
32
|
-
$
|
|
33
|
-
size: (
|
|
34
|
-
var: --rmd-layout-size,
|
|
35
|
-
value: $navigation-static-width,
|
|
36
|
-
),
|
|
37
|
-
header-height: (
|
|
38
|
-
var: --rmd-layout-header-height,
|
|
39
|
-
value: $header-height,
|
|
40
|
-
),
|
|
41
|
-
);
|
|
32
|
+
$variables: (size, header-height);
|
|
42
33
|
|
|
43
34
|
@function get-var($name, $fallback: null) {
|
|
44
|
-
$
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
@if $value {
|
|
49
|
-
@return var(#{$var}, #{$value});
|
|
35
|
+
$var: utils.get-var-name($variables, $name, "layout");
|
|
36
|
+
@if $fallback {
|
|
37
|
+
@return var(#{$var}, #{$fallback});
|
|
50
38
|
}
|
|
51
39
|
|
|
52
40
|
@return var(#{$var});
|
|
53
41
|
}
|
|
54
42
|
|
|
55
43
|
@mixin set-var($name, $value) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
@if $value {
|
|
45
|
+
#{utils.get-var-name($variables, $name, "layout")}: #{$value};
|
|
46
|
+
}
|
|
59
47
|
}
|
|
60
48
|
|
|
61
49
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
62
50
|
#{$property}: get-var($name, $fallback);
|
|
63
51
|
}
|
|
64
52
|
|
|
53
|
+
@mixin variables {
|
|
54
|
+
@if not $disable-everything {
|
|
55
|
+
@include set-var(size, $navigation-static-width);
|
|
56
|
+
@include set-var(header-height, $header-height);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
65
60
|
@mixin styles {
|
|
66
61
|
@if not $disable-everything {
|
|
67
62
|
.rmd-layout-main {
|
package/dist/link/_link.scss
CHANGED
|
@@ -29,37 +29,21 @@ $skip-to-main-active-styles: (
|
|
|
29
29
|
outline: 0.25rem dashed #000,
|
|
30
30
|
) !default;
|
|
31
31
|
|
|
32
|
-
$
|
|
33
|
-
color: (
|
|
34
|
-
var: --rmd-link-color,
|
|
35
|
-
value: $color,
|
|
36
|
-
),
|
|
37
|
-
visited-color: (
|
|
38
|
-
var: --rmd-link-visited-color,
|
|
39
|
-
value: $visited-color,
|
|
40
|
-
),
|
|
41
|
-
hover-color: (
|
|
42
|
-
var: --rmd-link-hover-color,
|
|
43
|
-
value: $hover-color,
|
|
44
|
-
),
|
|
45
|
-
);
|
|
32
|
+
$variables: (color, visited-color, hover-color);
|
|
46
33
|
|
|
47
34
|
@function get-var($name, $fallback: null) {
|
|
48
|
-
$
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
@if $value {
|
|
53
|
-
@return var(#{$var}, #{$value});
|
|
35
|
+
$var: utils.get-var-name($variables, $name, "link");
|
|
36
|
+
@if $fallback {
|
|
37
|
+
@return var(#{$var}, #{$fallback});
|
|
54
38
|
}
|
|
55
39
|
|
|
56
40
|
@return var(#{$var});
|
|
57
41
|
}
|
|
58
42
|
|
|
59
43
|
@mixin set-var($name, $value) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
@if $value {
|
|
45
|
+
#{utils.get-var-name($variables, $name, "link")}: #{$value};
|
|
46
|
+
}
|
|
63
47
|
}
|
|
64
48
|
|
|
65
49
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
@@ -80,6 +64,14 @@ $var-lookup: (
|
|
|
80
64
|
#{$property}: get-var(size) inset get-var(color);
|
|
81
65
|
}
|
|
82
66
|
|
|
67
|
+
@mixin variables {
|
|
68
|
+
@if not $disable-everything {
|
|
69
|
+
@include set-var(color, $color);
|
|
70
|
+
@include set-var(visited-color, $visited-color);
|
|
71
|
+
@include set-var(hover-color, $hover-color);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
83
75
|
@mixin styles {
|
|
84
76
|
@if not $disable-everything {
|
|
85
77
|
.rmd-link {
|
package/dist/list/_list.scss
CHANGED
|
@@ -60,77 +60,35 @@ $item-media-large-size: 6.25rem !default;
|
|
|
60
60
|
|
|
61
61
|
$item-keyline: 4.5rem !default;
|
|
62
62
|
|
|
63
|
-
$
|
|
64
|
-
horizontal-padding
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
vertical-padding
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
item-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
item-
|
|
77
|
-
var: --rmd-list-item-padding-h,
|
|
78
|
-
value: $item-horizontal-padding,
|
|
79
|
-
),
|
|
80
|
-
item-vertical-padding: (
|
|
81
|
-
var: --rmd-list-item-padding-v,
|
|
82
|
-
value: $item-vertical-padding,
|
|
83
|
-
),
|
|
84
|
-
item-height: (
|
|
85
|
-
var: --rmd-list-item-height,
|
|
86
|
-
value: $item-height,
|
|
87
|
-
),
|
|
88
|
-
item-medium-height: (
|
|
89
|
-
var: --rmd-list-item-medium-height,
|
|
90
|
-
value: $item-medium-height,
|
|
91
|
-
),
|
|
92
|
-
item-large-height: (
|
|
93
|
-
var: --rmd-list-item-large-height,
|
|
94
|
-
value: $item-large-height,
|
|
95
|
-
),
|
|
96
|
-
item-extra-large-height: (
|
|
97
|
-
var: --rmd-list-item-extra-large-height,
|
|
98
|
-
value: $item-extra-large-height,
|
|
99
|
-
),
|
|
100
|
-
item-three-line-height: (
|
|
101
|
-
var: --rmd-list-item-three-line-height,
|
|
102
|
-
value: $item-three-line-height,
|
|
103
|
-
),
|
|
104
|
-
item-media-size: (
|
|
105
|
-
var: --rmd-list-item-media-size,
|
|
106
|
-
value: $item-media-size,
|
|
107
|
-
),
|
|
108
|
-
item-media-spacing: (
|
|
109
|
-
var: --rmd-list-item-media-spacing,
|
|
110
|
-
value: $item-media-spacing,
|
|
111
|
-
),
|
|
112
|
-
text-three-line-height: (
|
|
113
|
-
var: --rmd-list-item-text-three-line-height,
|
|
114
|
-
value: $item-secondary-text-three-line-max-height,
|
|
115
|
-
),
|
|
63
|
+
$variables: (
|
|
64
|
+
horizontal-padding,
|
|
65
|
+
vertical-padding,
|
|
66
|
+
item-keyline,
|
|
67
|
+
item-horizontal-padding,
|
|
68
|
+
item-vertical-padding,
|
|
69
|
+
item-height,
|
|
70
|
+
item-medium-height,
|
|
71
|
+
item-large-height,
|
|
72
|
+
item-extra-large-height,
|
|
73
|
+
item-three-line-height,
|
|
74
|
+
item-media-size,
|
|
75
|
+
item-media-spacing,
|
|
76
|
+
item-text-three-line-height
|
|
116
77
|
);
|
|
117
78
|
|
|
118
79
|
@function get-var($name, $fallback: null) {
|
|
119
|
-
$
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
@if $value {
|
|
124
|
-
@return var(#{$var}, #{$value});
|
|
80
|
+
$var: utils.get-var-name($variables, $name, "list");
|
|
81
|
+
@if $fallback {
|
|
82
|
+
@return var(#{$var}, #{$fallback});
|
|
125
83
|
}
|
|
126
84
|
|
|
127
85
|
@return var(#{$var});
|
|
128
86
|
}
|
|
129
87
|
|
|
130
88
|
@mixin set-var($name, $value) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
89
|
+
@if $value {
|
|
90
|
+
#{utils.get-var-name($variables, $name, "list")}: #{$value};
|
|
91
|
+
}
|
|
134
92
|
}
|
|
135
93
|
|
|
136
94
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
@@ -147,6 +105,38 @@ $var-lookup: (
|
|
|
147
105
|
);
|
|
148
106
|
}
|
|
149
107
|
|
|
108
|
+
@mixin variables {
|
|
109
|
+
@if not $disable-everything {
|
|
110
|
+
@include set-var(horizontal-padding, $horizontal-padding);
|
|
111
|
+
@include set-var(vertical-padding, $vertical-padding);
|
|
112
|
+
@include set-var(item-horizontal-padding, $item-horizontal-padding);
|
|
113
|
+
@include set-var(item-vertical-padding, $item-vertical-padding);
|
|
114
|
+
|
|
115
|
+
@include set-var(item-height, $item-height);
|
|
116
|
+
@if not $disable-medium-height {
|
|
117
|
+
@include set-var(item-medium-height, $item-medium-height);
|
|
118
|
+
}
|
|
119
|
+
@if not $disable-large-height {
|
|
120
|
+
@include set-var(item-large-height, $item-large-height);
|
|
121
|
+
}
|
|
122
|
+
@if not $disable-extra-large-height {
|
|
123
|
+
@include set-var(item-extra-large-height, $item-extra-large-height);
|
|
124
|
+
}
|
|
125
|
+
@if not $disable-three-line-height {
|
|
126
|
+
@include set-var(item-three-line-height, $item-three-line-height);
|
|
127
|
+
@include set-var(
|
|
128
|
+
item-text-three-line-height,
|
|
129
|
+
$item-secondary-text-three-line-max-height
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@if not $disable-item-media {
|
|
134
|
+
@include set-var(item-media-size, $item-media-size);
|
|
135
|
+
@include set-var(item-media-spacing, $item-media-spacing);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
150
140
|
@mixin styles {
|
|
151
141
|
@if not $disable-everything {
|
|
152
142
|
.rmd-list {
|
|
@@ -243,7 +233,7 @@ $var-lookup: (
|
|
|
243
233
|
|
|
244
234
|
&--clamped {
|
|
245
235
|
@include typography.line-clamp;
|
|
246
|
-
@include use-var(max-height, text-three-line-height);
|
|
236
|
+
@include use-var(max-height, item-text-three-line-height);
|
|
247
237
|
|
|
248
238
|
line-height: $item-secondary-text-line-height;
|
|
249
239
|
white-space: normal;
|