@fluentui/react-migration-v0-v9 9.2.16 → 9.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -2
- package/dist/index.d.ts +2 -2
- package/lib/components/Attachment/Attachment.js.map +1 -1
- package/lib/components/Attachment/Attachment.styles.js +1 -2
- package/lib/components/Attachment/AttachmentAction.js.map +1 -1
- package/lib/components/Attachment/AttachmentAction.styles.js +1 -2
- package/lib/components/Attachment/AttachmentBody.js.map +1 -1
- package/lib/components/Attachment/AttachmentBody.styles.js +1 -2
- package/lib/components/Attachment/AttachmentDescription.js.map +1 -1
- package/lib/components/Attachment/AttachmentDescription.styles.js +1 -2
- package/lib/components/Attachment/AttachmentHeader.js.map +1 -1
- package/lib/components/Attachment/AttachmentHeader.styles.js +1 -2
- package/lib/components/Attachment/AttachmentIcon.js.map +1 -1
- package/lib/components/Attachment/AttachmentIcon.styles.js +1 -2
- package/lib/components/Attachment/index.js.map +1 -1
- package/lib/components/Button/ButtonMigration.mixins.js.map +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Flex/Flex.styles.js +1 -2
- package/lib/components/Flex/FlexItem.mixins.js.map +1 -1
- package/lib/components/Flex/index.js.map +1 -1
- package/lib/components/FormField/FormFieldShim.js.map +1 -1
- package/lib/components/FormField/index.js.map +1 -1
- package/lib/components/Grid/Grid.mixins.js.map +1 -1
- package/lib/components/Grid/Grid.styles.js +1 -2
- package/lib/components/Grid/GridShim.js.map +1 -1
- package/lib/components/Grid/index.js.map +1 -1
- package/lib/components/Input/Input.mixins.js.map +1 -1
- package/lib/components/Input/index.js.map +1 -1
- package/lib/components/ItemLayout/ItemLayout.js +13 -2
- package/lib/components/ItemLayout/ItemLayout.js.map +1 -1
- package/lib/components/ItemLayout/ItemLayout.styles.js +1 -2
- package/lib/components/ItemLayout/index.js.map +1 -1
- package/lib/components/List/List/List.js.map +1 -1
- package/lib/components/List/List/List.types.js.map +1 -1
- package/lib/components/List/List/index.js.map +1 -1
- package/lib/components/List/List/listContext.js.map +1 -1
- package/lib/components/List/List/renderList.js.map +1 -1
- package/lib/components/List/List/useList.js.map +1 -1
- package/lib/components/List/List/useListContextValues.js.map +1 -1
- package/lib/components/List/List/useListStyles.styles.js +1 -2
- package/lib/components/List/ListItem/ListItem.js.map +1 -1
- package/lib/components/List/ListItem/ListItem.types.js.map +1 -1
- package/lib/components/List/ListItem/index.js.map +1 -1
- package/lib/components/List/ListItem/renderListItem.js.map +1 -1
- package/lib/components/List/ListItem/useListItem.js.map +1 -1
- package/lib/components/List/ListItem/useListItemStyles.styles.js +1 -2
- package/lib/components/List/hooks/index.js.map +1 -1
- package/lib/components/List/hooks/types.js.map +1 -1
- package/lib/components/List/hooks/useListSelection.js.map +1 -1
- package/lib/components/List/index.js.map +1 -1
- package/lib/components/Primitive/Primitive.js.map +1 -1
- package/lib/components/Primitive/index.js.map +1 -1
- package/lib/components/Segment/Segment.js.map +1 -1
- package/lib/components/Segment/Segment.styles.js +1 -2
- package/lib/components/Segment/index.js.map +1 -1
- package/lib/components/Slider/Slider.mixins.js.map +1 -1
- package/lib/components/Slider/index.js.map +1 -1
- package/lib/components/Spinner/SpinnerMigration.mixins.js.map +1 -1
- package/lib/components/Spinner/index.js.map +1 -1
- package/lib/components/StyledText/StyledText.js.map +1 -1
- package/lib/components/StyledText/StyledText.styles.js +1 -2
- package/lib/components/StyledText/index.js.map +1 -1
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/Video.styles.js +1 -2
- package/lib/components/Video/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.styles.js +1 -1
- package/lib-commonjs/components/Attachment/AttachmentAction.js.map +1 -1
- package/lib-commonjs/components/Attachment/AttachmentAction.styles.js +1 -1
- package/lib-commonjs/components/Attachment/AttachmentBody.js.map +1 -1
- package/lib-commonjs/components/Attachment/AttachmentBody.styles.js +1 -1
- package/lib-commonjs/components/Attachment/AttachmentDescription.js.map +1 -1
- package/lib-commonjs/components/Attachment/AttachmentDescription.styles.js +1 -1
- package/lib-commonjs/components/Attachment/AttachmentHeader.js.map +1 -1
- package/lib-commonjs/components/Attachment/AttachmentHeader.styles.js +1 -1
- package/lib-commonjs/components/Attachment/AttachmentIcon.js.map +1 -1
- package/lib-commonjs/components/Attachment/AttachmentIcon.styles.js +1 -1
- package/lib-commonjs/components/Attachment/index.js.map +1 -1
- package/lib-commonjs/components/Button/ButtonMigration.mixins.js.map +1 -1
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Flex/Flex.js.map +1 -1
- package/lib-commonjs/components/Flex/Flex.styles.js +1 -1
- package/lib-commonjs/components/Flex/FlexItem.mixins.js.map +1 -1
- package/lib-commonjs/components/Flex/index.js.map +1 -1
- package/lib-commonjs/components/FormField/FormFieldShim.js.map +1 -1
- package/lib-commonjs/components/FormField/index.js.map +1 -1
- package/lib-commonjs/components/Grid/Grid.mixins.js.map +1 -1
- package/lib-commonjs/components/Grid/Grid.styles.js +1 -1
- package/lib-commonjs/components/Grid/GridShim.js.map +1 -1
- package/lib-commonjs/components/Grid/index.js.map +1 -1
- package/lib-commonjs/components/Input/Input.mixins.js.map +1 -1
- package/lib-commonjs/components/Input/index.js.map +1 -1
- package/lib-commonjs/components/ItemLayout/ItemLayout.js +14 -3
- package/lib-commonjs/components/ItemLayout/ItemLayout.js.map +1 -1
- package/lib-commonjs/components/ItemLayout/ItemLayout.styles.js +1 -1
- package/lib-commonjs/components/ItemLayout/index.js.map +1 -1
- package/lib-commonjs/components/List/List/List.js.map +1 -1
- package/lib-commonjs/components/List/List/List.types.js.map +1 -1
- package/lib-commonjs/components/List/List/index.js.map +1 -1
- package/lib-commonjs/components/List/List/listContext.js.map +1 -1
- package/lib-commonjs/components/List/List/renderList.js.map +1 -1
- package/lib-commonjs/components/List/List/useList.js.map +1 -1
- package/lib-commonjs/components/List/List/useListContextValues.js.map +1 -1
- package/lib-commonjs/components/List/List/useListStyles.styles.js +1 -1
- package/lib-commonjs/components/List/ListItem/ListItem.js.map +1 -1
- package/lib-commonjs/components/List/ListItem/ListItem.types.js.map +1 -1
- package/lib-commonjs/components/List/ListItem/index.js.map +1 -1
- package/lib-commonjs/components/List/ListItem/renderListItem.js.map +1 -1
- package/lib-commonjs/components/List/ListItem/useListItem.js.map +1 -1
- package/lib-commonjs/components/List/ListItem/useListItemStyles.styles.js +1 -1
- package/lib-commonjs/components/List/hooks/index.js.map +1 -1
- package/lib-commonjs/components/List/hooks/types.js.map +1 -1
- package/lib-commonjs/components/List/hooks/useListSelection.js.map +1 -1
- package/lib-commonjs/components/List/index.js.map +1 -1
- package/lib-commonjs/components/Primitive/Primitive.js.map +1 -1
- package/lib-commonjs/components/Primitive/index.js.map +1 -1
- package/lib-commonjs/components/Segment/Segment.js.map +1 -1
- package/lib-commonjs/components/Segment/Segment.styles.js +1 -1
- package/lib-commonjs/components/Segment/index.js.map +1 -1
- package/lib-commonjs/components/Slider/Slider.mixins.js.map +1 -1
- package/lib-commonjs/components/Slider/index.js.map +1 -1
- package/lib-commonjs/components/Spinner/SpinnerMigration.mixins.js.map +1 -1
- package/lib-commonjs/components/Spinner/index.js.map +1 -1
- package/lib-commonjs/components/StyledText/StyledText.js.map +1 -1
- package/lib-commonjs/components/StyledText/StyledText.styles.js +1 -1
- package/lib-commonjs/components/StyledText/index.js.map +1 -1
- package/lib-commonjs/components/Video/Video.js.map +1 -1
- package/lib-commonjs/components/Video/Video.styles.js +1 -1
- package/lib-commonjs/components/Video/index.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { Flex, flexClassName } from './Flex';\nexport type { FlexProps } from './Flex';\nexport { useFlexStyles } from './Flex.styles';\nexport { flexItem } from './FlexItem.mixins';\n"],"names":["Flex","flexClassName","flexItem","useFlexStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAAEC,aAAa;eAAbA,mBAAa;;IAGnBC,QAAQ;eAARA,wBAAQ;;IADRC,aAAa;eAAbA,yBAAa;;;sBAFc;4BAEN;gCACL"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Flex/index.ts"],"sourcesContent":["export { Flex, flexClassName } from './Flex';\nexport type { FlexProps } from './Flex';\nexport { useFlexStyles } from './Flex.styles';\nexport { flexItem } from './FlexItem.mixins';\n"],"names":["Flex","flexClassName","flexItem","useFlexStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAAEC,aAAa;eAAbA,mBAAa;;IAGnBC,QAAQ;eAARA,wBAAQ;;IADRC,aAAa;eAAbA,yBAAa;;;sBAFc;4BAEN;gCACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FormFieldShim.tsx"],"sourcesContent":["import {\n FieldProps,\n renderField_unstable,\n useFieldContextValues_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-components';\nimport type { ObjectShorthandValue } from '@fluentui/react-northstar';\n\nimport * as React from 'react';\n\ntype WithContent = ObjectShorthandValue<React.HTMLAttributes<HTMLDivElement>> | string;\n\n/**\n *\n */\ntype CustomInputFieldProps = React.PropsWithChildren<{\n /**\n * Message to be shown when error state is true\n */\n errorMessage?: WithContent;\n /**\n * Whether the field label should be marked as required.\n */\n required?: boolean;\n /**\n * Control to be rendered\n */\n control?: ObjectShorthandValue<{\n /**\n * Control content\n */\n content?: React.ReactNode;\n }> & {\n /**\n * Error state\n */\n error?: 'true' | 'false';\n };\n /**\n * Label to be rendered\n */\n label?: WithContent;\n}>;\n\nexport const FormFieldShim = React.forwardRef<HTMLInputElement, CustomInputFieldProps>((props, ref) => {\n const { errorMessage, required, control, label } = props;\n const fieldProps: FieldProps = { required };\n\n if (errorMessage && control?.error === 'true') {\n fieldProps.validationState = 'error';\n if (typeof errorMessage === 'object') {\n fieldProps.validationMessage = errorMessage.content;\n }\n if (typeof errorMessage === 'string') {\n fieldProps.validationMessage = errorMessage;\n }\n }\n\n if (label) {\n if (typeof label === 'object') {\n fieldProps.label = label.content;\n } else {\n fieldProps.label = label;\n }\n }\n\n const children: FieldProps['children'] = props.children || control?.content;\n\n if (React.isValidElement(children)) {\n const child: React.ReactElement = children;\n\n // Use the Field's child render function to pass the field control props to the child\n fieldProps.children = fieldControlProps => React.cloneElement(child, { ...fieldControlProps, ...child.props });\n } else {\n fieldProps.children = children;\n }\n\n const state = useField_unstable(fieldProps, ref);\n useFieldStyles_unstable(state);\n const context = useFieldContextValues_unstable(state);\n return renderField_unstable(state, context);\n});\n\nFormFieldShim.displayName = 'FormFieldShim';\n"],"names":["FormFieldShim","React","forwardRef","props","ref","errorMessage","required","control","label","fieldProps","error","validationState","validationMessage","content","children","isValidElement","child","fieldControlProps","cloneElement","state","useField_unstable","useFieldStyles_unstable","context","useFieldContextValues_unstable","renderField_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA6CaA;;;eAAAA;;;;iCAvCN;iEAGgB;AAoChB,MAAMA,gBAAAA,WAAAA,GAAgBC,OAAMC,UAAU,CAA0C,CAACC,OAAOC;IAC7F,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAGL;IACnD,MAAMM,aAAyB;QAAEH;IAAS;IAE1C,IAAID,gBAAgBE,CAAAA,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASG,KAAK,AAALA,MAAU,QAAQ;QAC7CD,WAAWE,eAAe,GAAG;QAC7B,IAAI,OAAON,iBAAiB,UAAU;YACpCI,WAAWG,iBAAiB,GAAGP,aAAaQ,OAAO;QACrD;QACA,IAAI,OAAOR,iBAAiB,UAAU;YACpCI,WAAWG,iBAAiB,GAAGP;QACjC;IACF;IAEA,IAAIG,OAAO;QACT,IAAI,OAAOA,UAAU,UAAU;YAC7BC,WAAWD,KAAK,GAAGA,MAAMK,OAAO;QAClC,OAAO;YACLJ,WAAWD,KAAK,GAAGA;QACrB;IACF;IAEA,MAAMM,WAAmCX,MAAMW,QAAQ,IAAIP,CAAAA,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASM,OAAO,AAAPA;IAEpE,IAAA,WAAA,GAAIZ,OAAMc,cAAc,CAACD,WAAW;QAClC,MAAME,QAA4BF;QAElC,qFAAqF;QACrFL,WAAWK,QAAQ,GAAGG,CAAAA,oBAAAA,WAAAA,GAAqBhB,OAAMiB,YAAY,CAACF,OAAO;gBAAE,GAAGC,iBAAiB;gBAAE,GAAGD,MAAMb,KAAK;YAAC;IAC9G,OAAO;QACLM,WAAWK,QAAQ,GAAGA;IACxB;IAEA,MAAMK,QAAQC,IAAAA,kCAAAA,EAAkBX,YAAYL;IAC5CiB,IAAAA,wCAAAA,EAAwBF;IACxB,MAAMG,UAAUC,IAAAA,+CAAAA,EAA+BJ;IAC/C,OAAOK,IAAAA,qCAAAA,EAAqBL,OAAOG;AACrC;AAEAtB,cAAcyB,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/FormField/FormFieldShim.tsx"],"sourcesContent":["import {\n FieldProps,\n renderField_unstable,\n useFieldContextValues_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-components';\nimport type { ObjectShorthandValue } from '@fluentui/react-northstar';\n\nimport * as React from 'react';\n\ntype WithContent = ObjectShorthandValue<React.HTMLAttributes<HTMLDivElement>> | string;\n\n/**\n *\n */\ntype CustomInputFieldProps = React.PropsWithChildren<{\n /**\n * Message to be shown when error state is true\n */\n errorMessage?: WithContent;\n /**\n * Whether the field label should be marked as required.\n */\n required?: boolean;\n /**\n * Control to be rendered\n */\n control?: ObjectShorthandValue<{\n /**\n * Control content\n */\n content?: React.ReactNode;\n }> & {\n /**\n * Error state\n */\n error?: 'true' | 'false';\n };\n /**\n * Label to be rendered\n */\n label?: WithContent;\n}>;\n\nexport const FormFieldShim = React.forwardRef<HTMLInputElement, CustomInputFieldProps>((props, ref) => {\n const { errorMessage, required, control, label } = props;\n const fieldProps: FieldProps = { required };\n\n if (errorMessage && control?.error === 'true') {\n fieldProps.validationState = 'error';\n if (typeof errorMessage === 'object') {\n fieldProps.validationMessage = errorMessage.content;\n }\n if (typeof errorMessage === 'string') {\n fieldProps.validationMessage = errorMessage;\n }\n }\n\n if (label) {\n if (typeof label === 'object') {\n fieldProps.label = label.content;\n } else {\n fieldProps.label = label;\n }\n }\n\n const children: FieldProps['children'] = props.children || control?.content;\n\n if (React.isValidElement(children)) {\n const child: React.ReactElement = children;\n\n // Use the Field's child render function to pass the field control props to the child\n fieldProps.children = fieldControlProps => React.cloneElement(child, { ...fieldControlProps, ...child.props });\n } else {\n fieldProps.children = children;\n }\n\n const state = useField_unstable(fieldProps, ref);\n useFieldStyles_unstable(state);\n const context = useFieldContextValues_unstable(state);\n return renderField_unstable(state, context);\n});\n\nFormFieldShim.displayName = 'FormFieldShim';\n"],"names":["FormFieldShim","React","forwardRef","props","ref","errorMessage","required","control","label","fieldProps","error","validationState","validationMessage","content","children","isValidElement","child","fieldControlProps","cloneElement","state","useField_unstable","useFieldStyles_unstable","context","useFieldContextValues_unstable","renderField_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA6CaA;;;eAAAA;;;;iCAvCN;iEAGgB;AAoChB,MAAMA,gBAAAA,WAAAA,GAAgBC,OAAMC,UAAU,CAA0C,CAACC,OAAOC;IAC7F,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,OAAO,EAAE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"}
|
|
1
|
+
{"version":3,"sources":["../src/components/FormField/index.ts"],"sourcesContent":["export * from './FormFieldShim';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Grid.mixins.ts"],"sourcesContent":["import { GriffelStyle } from '@fluentui/react-components';\n\nconst getCSSTemplateValue = (template: string | number): string => {\n const templateAsNumber = Number(template);\n\n return !isNaN(templateAsNumber) && templateAsNumber > 0 ? `repeat(${template}, 1fr)` : String(template);\n};\n\nconst columns = (template: string): GriffelStyle => ({\n gridTemplateColumns: getCSSTemplateValue(template),\n});\n\nconst rows = (template: string): GriffelStyle => ({\n gridTemplateRows: getCSSTemplateValue(template),\n});\n\nexport const grid = {\n columns,\n rows,\n};\n"],"names":["grid","getCSSTemplateValue","template","templateAsNumber","Number","isNaN","String","columns","gridTemplateColumns","rows","gridTemplateRows"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;AAdb,MAAMC,sBAAsB,CAACC;IAC3B,MAAMC,mBAAmBC,OAAOF;IAEhC,OAAO,CAACG,MAAMF,qBAAqBA,mBAAmB,IAAI,CAAC,OAAO,EAAED,SAAS,MAAM,CAAC,GAAGI,OAAOJ;AAChG;AAEA,MAAMK,UAAU,CAACL,WAAoC,CAAA;QACnDM,qBAAqBP,oBAAoBC;IAC3C,CAAA;AAEA,MAAMO,OAAO,CAACP,WAAoC,CAAA;QAChDQ,kBAAkBT,oBAAoBC;IACxC,CAAA;AAEO,MAAMF,OAAO;IAClBO;IACAE;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Grid/Grid.mixins.ts"],"sourcesContent":["import { GriffelStyle } from '@fluentui/react-components';\n\nconst getCSSTemplateValue = (template: string | number): string => {\n const templateAsNumber = Number(template);\n\n return !isNaN(templateAsNumber) && templateAsNumber > 0 ? `repeat(${template}, 1fr)` : String(template);\n};\n\nconst columns = (template: string): GriffelStyle => ({\n gridTemplateColumns: getCSSTemplateValue(template),\n});\n\nconst rows = (template: string): GriffelStyle => ({\n gridTemplateRows: getCSSTemplateValue(template),\n});\n\nexport const grid = {\n columns,\n rows,\n};\n"],"names":["grid","getCSSTemplateValue","template","templateAsNumber","Number","isNaN","String","columns","gridTemplateColumns","rows","gridTemplateRows"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;AAdb,MAAMC,sBAAsB,CAACC;IAC3B,MAAMC,mBAAmBC,OAAOF;IAEhC,OAAO,CAACG,MAAMF,qBAAqBA,mBAAmB,IAAI,CAAC,OAAO,EAAED,SAAS,MAAM,CAAC,GAAGI,OAAOJ;AAChG;AAEA,MAAMK,UAAU,CAACL,WAAoC,CAAA;QACnDM,qBAAqBP,oBAAoBC;IAC3C,CAAA;AAEA,MAAMO,OAAO,CAACP,WAAoC,CAAA;QAChDQ,kBAAkBT,oBAAoBC;IACxC,CAAA;AAEO,MAAMF,OAAO;IAClBO;IACAE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GridShim.tsx"],"sourcesContent":["import { mergeClasses } from '@fluentui/react-components';\nimport * as React from 'react';\nimport { useGridStyles } from './Grid.styles';\n\nexport interface GridShimProps {\n /**\n * The columns of the grid with a space-separated list of values.\n * The values represent the track size, and the space between them represents the grid line.\n */\n columns?: 1 | 2 | 3;\n\n /**\n * The rows of the grid with a space-separated list of values.\n * The values represent the track size, and the space between them represents the grid line.\n */\n rows?: 1 | 2 | 3;\n}\n\nexport const gridShimClassName = 'fui-Grid';\n\nexport const GridShim = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement> & GridShimProps>(\n (props, ref) => {\n const { rows, columns, className, ...rest } = props;\n const classes = useGridStyles();\n\n const classMaps = React.useMemo(\n () => ({\n rowsClasses: {\n 1: classes.rows1,\n 2: classes.rows2,\n 3: classes.rows3,\n },\n columnsClasses: {\n 1: classes.columns1,\n 2: classes.columns2,\n 3: classes.columns3,\n },\n }),\n [classes],\n );\n\n const gridClasses = mergeClasses(\n gridShimClassName,\n classes.grid,\n !rows && !columns && classes.columnsDefault,\n rows && !columns && classes.onlyRows,\n rows && classMaps.rowsClasses[rows],\n columns && classMaps.columnsClasses[columns],\n className,\n );\n return <div ref={ref} className={gridClasses} {...rest} />;\n },\n);\n\nGridShim.displayName = 'GridShim';\n"],"names":["GridShim","gridShimClassName","React","forwardRef","props","ref","rows","columns","className","rest","classes","useGridStyles","classMaps","useMemo","rowsClasses","rows1","rows2","rows3","columnsClasses","columns1","columns2","columns3","gridClasses","mergeClasses","grid","columnsDefault","onlyRows","createElement","div","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAoBaA,QAAAA;eAAAA;;IAFAC,iBAAAA;eAAAA;;;;iCAlBgB;iEACN;4BACO;AAgBvB,MAAMA,oBAAoB;AAE1B,MAAMD,WAAAA,WAAAA,GAAWE,OAAMC,UAAU,CACtC,CAACC,OAAOC;IACN,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGL;IAC9C,MAAMM,UAAUC,IAAAA,yBAAAA;IAEhB,MAAMC,YAAYV,OAAMW,OAAO,CAC7B,IAAO,CAAA;YACLC,aAAa;gBACX,GAAGJ,QAAQK,KAAK;gBAChB,GAAGL,QAAQM,KAAK;gBAChB,GAAGN,QAAQO,KAAK;YAClB;YACAC,gBAAgB;gBACd,GAAGR,QAAQS,QAAQ;gBACnB,GAAGT,QAAQU,QAAQ;gBACnB,GAAGV,QAAQW,QAAQ;YACrB;QACF,CAAA,GACA;QAACX;KAAQ;IAGX,MAAMY,cAAcC,IAAAA,6BAAAA,EAClBtB,mBACAS,QAAQc,IAAI,EACZ,CAAClB,QAAQ,CAACC,WAAWG,QAAQe,cAAc,EAC3CnB,QAAQ,CAACC,WAAWG,QAAQgB,QAAQ,EACpCpB,QAAQM,UAAUE,WAAW,CAACR,KAAK,EACnCC,WAAWK,UAAUM,cAAc,CAACX,QAAQ,EAC5CC;IAEF,OAAA,WAAA,GAAON,OAAAyB,aAAA,CAACC,OAAAA;QAAIvB,KAAKA;QAAKG,WAAWc;QAAc,GAAGb,IAAI;;AACxD;AAGFT,SAAS6B,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Grid/GridShim.tsx"],"sourcesContent":["import { mergeClasses } from '@fluentui/react-components';\nimport * as React from 'react';\nimport { useGridStyles } from './Grid.styles';\n\nexport interface GridShimProps {\n /**\n * The columns of the grid with a space-separated list of values.\n * The values represent the track size, and the space between them represents the grid line.\n */\n columns?: 1 | 2 | 3;\n\n /**\n * The rows of the grid with a space-separated list of values.\n * The values represent the track size, and the space between them represents the grid line.\n */\n rows?: 1 | 2 | 3;\n}\n\nexport const gridShimClassName = 'fui-Grid';\n\nexport const GridShim = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement> & GridShimProps>(\n (props, ref) => {\n const { rows, columns, className, ...rest } = props;\n const classes = useGridStyles();\n\n const classMaps = React.useMemo(\n () => ({\n rowsClasses: {\n 1: classes.rows1,\n 2: classes.rows2,\n 3: classes.rows3,\n },\n columnsClasses: {\n 1: classes.columns1,\n 2: classes.columns2,\n 3: classes.columns3,\n },\n }),\n [classes],\n );\n\n const gridClasses = mergeClasses(\n gridShimClassName,\n classes.grid,\n !rows && !columns && classes.columnsDefault,\n rows && !columns && classes.onlyRows,\n rows && classMaps.rowsClasses[rows],\n columns && classMaps.columnsClasses[columns],\n className,\n );\n return <div ref={ref} className={gridClasses} {...rest} />;\n },\n);\n\nGridShim.displayName = 'GridShim';\n"],"names":["GridShim","gridShimClassName","React","forwardRef","props","ref","rows","columns","className","rest","classes","useGridStyles","classMaps","useMemo","rowsClasses","rows1","rows2","rows3","columnsClasses","columns1","columns2","columns3","gridClasses","mergeClasses","grid","columnsDefault","onlyRows","createElement","div","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAoBaA,QAAAA;eAAAA;;IAFAC,iBAAAA;eAAAA;;;;iCAlBgB;iEACN;4BACO;AAgBvB,MAAMA,oBAAoB;AAE1B,MAAMD,WAAAA,WAAAA,GAAWE,OAAMC,UAAU,CACtC,CAACC,OAAOC;IACN,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGL;IAC9C,MAAMM,UAAUC,IAAAA,yBAAAA;IAEhB,MAAMC,YAAYV,OAAMW,OAAO,CAC7B,IAAO,CAAA;YACLC,aAAa;gBACX,GAAGJ,QAAQK,KAAK;gBAChB,GAAGL,QAAQM,KAAK;gBAChB,GAAGN,QAAQO,KAAK;YAClB;YACAC,gBAAgB;gBACd,GAAGR,QAAQS,QAAQ;gBACnB,GAAGT,QAAQU,QAAQ;gBACnB,GAAGV,QAAQW,QAAQ;YACrB;QACF,CAAA,GACA;QAACX;KAAQ;IAGX,MAAMY,cAAcC,IAAAA,6BAAAA,EAClBtB,mBACAS,QAAQc,IAAI,EACZ,CAAClB,QAAQ,CAACC,WAAWG,QAAQe,cAAc,EAC3CnB,QAAQ,CAACC,WAAWG,QAAQgB,QAAQ,EACpCpB,QAAQM,UAAUE,WAAW,CAACR,KAAK,EACnCC,WAAWK,UAAUM,cAAc,CAACX,QAAQ,EAC5CC;IAEF,OAAA,WAAA,GAAON,OAAAyB,aAAA,CAACC,OAAAA;QAAIvB,KAAKA;QAAKG,WAAWc;QAAc,GAAGb,IAAI;;AACxD;AAGFT,SAAS6B,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { GridShim, gridShimClassName as gridClassName } from './GridShim';\nexport type { GridShimProps } from './GridShim';\nexport { useGridStyles } from './Grid.styles';\nexport { grid } from './Grid.mixins';\n"],"names":["GridShim","grid","gridClassName","gridShimClassName","useGridStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAGRC,IAAI;eAAJA,gBAAI;;IAH2BC,aAAa;eAAlCC,2BAAAA;;IAEVC,aAAa;eAAbA,yBAAa;;;0BAFuC;4BAE/B;4BACT"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Grid/index.ts"],"sourcesContent":["export { GridShim, gridShimClassName as gridClassName } from './GridShim';\nexport type { GridShimProps } from './GridShim';\nexport { useGridStyles } from './Grid.styles';\nexport { grid } from './Grid.mixins';\n"],"names":["GridShim","grid","gridClassName","gridShimClassName","useGridStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,QAAQ;eAARA,kBAAQ;;IAGRC,IAAI;eAAJA,gBAAI;;IAH2BC,aAAa;eAAlCC,2BAAAA;;IAEVC,aAAa;eAAbA,yBAAa;;;0BAFuC;4BAE/B;4BACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Input.mixins.ts"],"sourcesContent":["import { GriffelStyle, tokens } from '@fluentui/react-components';\n\nconst fluid = (): GriffelStyle => ({ width: '100%' });\n\nconst error = (): GriffelStyle => ({ border: `1px solid ${tokens.colorPaletteRedBorderActive}` });\n\nconst errorIndicator = (): GriffelStyle => ({\n color: tokens.colorPaletteRedBorderActive,\n});\n\nconst successIndicator = (): GriffelStyle => ({\n color: tokens.colorPaletteGreenForeground1,\n});\n\nexport const input = {\n error,\n errorIndicator,\n fluid,\n successIndicator,\n};\n"],"names":["input","fluid","width","error","border","tokens","colorPaletteRedBorderActive","errorIndicator","color","successIndicator","colorPaletteGreenForeground1"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;iCAdwB;AAErC,MAAMC,QAAQ,IAAqB,CAAA;QAAEC,OAAO;IAAO,CAAA;AAEnD,MAAMC,QAAQ,IAAqB,CAAA;QAAEC,QAAQ,CAAC,UAAU,EAAEC,uBAAAA,CAAOC,2BAA2B,CAAC,CAAC;IAAC,CAAA;AAE/F,MAAMC,iBAAiB,IAAqB,CAAA;QAC1CC,OAAOH,uBAAAA,CAAOC,2BAA2B;IAC3C,CAAA;AAEA,MAAMG,mBAAmB,IAAqB,CAAA;QAC5CD,OAAOH,uBAAAA,CAAOK,4BAA4B;IAC5C,CAAA;AAEO,MAAMV,QAAQ;IACnBG;IACAI;IACAN;IACAQ;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Input/Input.mixins.ts"],"sourcesContent":["import { GriffelStyle, tokens } from '@fluentui/react-components';\n\nconst fluid = (): GriffelStyle => ({ width: '100%' });\n\nconst error = (): GriffelStyle => ({ border: `1px solid ${tokens.colorPaletteRedBorderActive}` });\n\nconst errorIndicator = (): GriffelStyle => ({\n color: tokens.colorPaletteRedBorderActive,\n});\n\nconst successIndicator = (): GriffelStyle => ({\n color: tokens.colorPaletteGreenForeground1,\n});\n\nexport const input = {\n error,\n errorIndicator,\n fluid,\n successIndicator,\n};\n"],"names":["input","fluid","width","error","border","tokens","colorPaletteRedBorderActive","errorIndicator","color","successIndicator","colorPaletteGreenForeground1"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;iCAdwB;AAErC,MAAMC,QAAQ,IAAqB,CAAA;QAAEC,OAAO;IAAO,CAAA;AAEnD,MAAMC,QAAQ,IAAqB,CAAA;QAAEC,QAAQ,CAAC,UAAU,EAAEC,uBAAAA,CAAOC,2BAA2B,CAAC,CAAC;IAAC,CAAA;AAE/F,MAAMC,iBAAiB,IAAqB,CAAA;QAC1CC,OAAOH,uBAAAA,CAAOC,2BAA2B;IAC3C,CAAA;AAEA,MAAMG,mBAAmB,IAAqB,CAAA;QAC5CD,OAAOH,uBAAAA,CAAOK,4BAA4B;IAC5C,CAAA;AAEO,MAAMV,QAAQ;IACnBG;IACAI;IACAN;IACAQ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { input } from './Input.mixins';\n"],"names":["input"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,kBAAK;;;6BAAQ"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Input/index.ts"],"sourcesContent":["export { input } from './Input.mixins';\n"],"names":["input"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,kBAAK;;;6BAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
@@ -17,7 +17,7 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
20
|
-
const
|
|
20
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
21
21
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
22
22
|
const _reactcomponents = require("@fluentui/react-components");
|
|
23
23
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
@@ -81,6 +81,17 @@ const ItemLayout = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
81
81
|
state.endMedia.className = (0, _reactcomponents.mergeClasses)(styles.endMedia, state.endMedia.className);
|
|
82
82
|
}
|
|
83
83
|
(0, _reactutilities.assertSlots)(state);
|
|
84
|
-
return /*#__PURE__*/ (0,
|
|
84
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
85
|
+
children: [
|
|
86
|
+
state.startMedia && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.startMedia, {}),
|
|
87
|
+
state.header && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.header, {}),
|
|
88
|
+
state.headerMedia && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.headerMedia, {}),
|
|
89
|
+
state.contentWrapper && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.contentWrapper, {
|
|
90
|
+
children: state.root.children
|
|
91
|
+
}),
|
|
92
|
+
state.contentMedia && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.contentMedia, {}),
|
|
93
|
+
state.endMedia && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.endMedia, {})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
85
96
|
});
|
|
86
97
|
ItemLayout.displayName = 'ItemLayout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ItemLayout.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["../src/components/ItemLayout/ItemLayout.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport { mergeClasses } from '@fluentui/react-components';\nimport {\n ComponentProps,\n ComponentState,\n getIntrinsicElementProps,\n Slot,\n slot,\n assertSlots,\n} from '@fluentui/react-utilities';\n\nimport { useItemLayoutStyles } from './ItemLayout.styles';\n\ntype ItemLayoutSlots = {\n root: Slot<'div'>;\n\n contentMedia?: Slot<'div'>;\n contentWrapper?: Slot<'div'>;\n\n header?: Slot<'div'>;\n headerMedia?: Slot<'div'>;\n\n startMedia?: Slot<'div'>;\n endMedia?: Slot<'div'>;\n};\n\ntype ItemLayoutProps = ComponentProps<ItemLayoutSlots>;\n\ntype ItemLayoutState = ComponentState<ItemLayoutSlots>;\n\nexport const itemLayoutClassName = 'fui-ItemLayout';\n\nexport const ItemLayout = React.forwardRef<HTMLDivElement, ItemLayoutProps>((props, ref) => {\n const state: ItemLayoutState = {\n components: {\n root: 'div',\n contentWrapper: 'div',\n contentMedia: 'div',\n header: 'div',\n headerMedia: 'div',\n startMedia: 'div',\n endMedia: 'div',\n },\n root: slot.always(getIntrinsicElementProps('div', { ...props, ref }), { elementType: 'div' }),\n contentMedia: slot.optional(props.contentMedia, { elementType: 'div' }),\n contentWrapper: slot.optional(props.contentWrapper, { renderByDefault: true, elementType: 'div' }),\n header: slot.optional(props.header, { elementType: 'div' }),\n headerMedia: slot.optional(props.headerMedia, { elementType: 'div' }),\n startMedia: slot.optional(props.startMedia, { elementType: 'div' }),\n endMedia: slot.optional(props.endMedia, { elementType: 'div' }),\n };\n const styles = useItemLayoutStyles();\n\n state.root.className = mergeClasses(itemLayoutClassName, styles.root, state.root.className);\n if (state.contentWrapper) {\n state.contentWrapper.className = mergeClasses(styles.contentWrapper, state.contentWrapper.className);\n }\n\n if (state.contentMedia) {\n state.contentMedia.className = mergeClasses(styles.contentMedia, state.contentMedia.className);\n }\n\n if (state.header) {\n state.header.className = mergeClasses(styles.header, state.header.className);\n }\n\n if (state.headerMedia) {\n state.headerMedia.className = mergeClasses(styles.headerMedia, state.headerMedia.className);\n }\n\n if (state.startMedia) {\n state.startMedia.className = mergeClasses(styles.startMedia, state.startMedia.className);\n }\n\n if (state.endMedia) {\n state.endMedia.className = mergeClasses(styles.endMedia, state.endMedia.className);\n }\n\n assertSlots<ItemLayoutSlots>(state);\n\n return (\n <state.root>\n {state.startMedia && <state.startMedia />}\n {state.header && <state.header />}\n {state.headerMedia && <state.headerMedia />}\n {state.contentWrapper && <state.contentWrapper>{state.root.children}</state.contentWrapper>}\n {state.contentMedia && <state.contentMedia />}\n {state.endMedia && <state.endMedia />}\n </state.root>\n );\n});\n\nItemLayout.displayName = 'ItemLayout';\n"],"names":["ItemLayout","itemLayoutClassName","React","forwardRef","props","ref","state","components","root","contentWrapper","contentMedia","header","headerMedia","startMedia","endMedia","slot","always","getIntrinsicElementProps","elementType","optional","renderByDefault","styles","useItemLayoutStyles","className","mergeClasses","assertSlots","_jsxs","_jsx","children","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAAIkB,IAAAA,eAAA,EAACrB,MAAMG,cAAc,EAAA;0BAAEH,MAAME,IAAI,CAACoB,QAAQ;;YAClEtB,MAAMI,YAAY,IAAA,WAAA,GAAIiB,IAAAA,eAAA,EAACrB,MAAMI,YAAY,EAAA,CAAA;YACzCJ,MAAMQ,QAAQ,IAAA,WAAA,GAAIa,IAAAA,eAAA,EAACrB,MAAMQ,QAAQ,EAAA,CAAA;;;AAGxC;AAEAd,WAAW6B,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"sourcesContent":["export * from './ItemLayout';\nexport * from './ItemLayout.styles';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
|
|
1
|
+
{"version":3,"sources":["../src/components/ItemLayout/index.tsx"],"sourcesContent":["export * from './ItemLayout';\nexport * from './ItemLayout.styles';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["List.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useList_unstable } from './useList';\nimport { renderList_unstable } from './renderList';\nimport { useListStyles_unstable } from './useListStyles.styles';\nimport type { ListProps } from './List.types';\nimport { useListContextValues_unstable } from './useListContextValues';\n\nexport const List: ForwardRefComponent<ListProps> = React.forwardRef((props, ref) => {\n const state = useList_unstable(props, ref);\n const contextValues = useListContextValues_unstable(state);\n\n useListStyles_unstable(state);\n useCustomStyleHook_unstable('useListStyles_unstable')(state);\n\n return renderList_unstable(state, contextValues);\n});\n\nList.displayName = 'List';\n"],"names":["List","React","forwardRef","props","ref","state","useList_unstable","contextValues","useListContextValues_unstable","useListStyles_unstable","useCustomStyleHook_unstable","renderList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;qCAEqB;yBACX;4BACG;qCACG;sCAEO;AAEvC,MAAMA,OAAAA,WAAAA,GAAuCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQC,IAAAA,yBAAAA,EAAiBH,OAAOC;IACtC,MAAMG,gBAAgBC,IAAAA,mDAAAA,EAA8BH;IAEpDI,IAAAA,2CAAAA,EAAuBJ;IACvBK,IAAAA,gDAAAA,EAA4B,0BAA0BL;IAEtD,OAAOM,IAAAA,+BAAAA,EAAoBN,OAAOE;AACpC;AAEAP,KAAKY,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/List.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useList_unstable } from './useList';\nimport { renderList_unstable } from './renderList';\nimport { useListStyles_unstable } from './useListStyles.styles';\nimport type { ListProps } from './List.types';\nimport { useListContextValues_unstable } from './useListContextValues';\n\nexport const List: ForwardRefComponent<ListProps> = React.forwardRef((props, ref) => {\n const state = useList_unstable(props, ref);\n const contextValues = useListContextValues_unstable(state);\n\n useListStyles_unstable(state);\n useCustomStyleHook_unstable('useListStyles_unstable')(state);\n\n return renderList_unstable(state, contextValues);\n});\n\nList.displayName = 'List';\n"],"names":["List","React","forwardRef","props","ref","state","useList_unstable","contextValues","useListContextValues_unstable","useListStyles_unstable","useCustomStyleHook_unstable","renderList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;iEATU;qCAEqB;yBACX;4BACG;qCACG;sCAEO;AAEvC,MAAMA,OAAAA,WAAAA,GAAuCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQC,IAAAA,yBAAAA,EAAiBH,OAAOC;IACtC,MAAMG,gBAAgBC,IAAAA,mDAAAA,EAA8BH;IAEpDI,IAAAA,2CAAAA,EAAuBJ;IACvBK,IAAAA,gDAAAA,EAA4B,0BAA0BL;IAEtD,OAAOM,IAAAA,+BAAAA,EAAoBN,OAAOE;AACpC;AAEAP,KAAKY,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["List.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, SelectionMode, SelectionItemId } from '@fluentui/react-utilities';\nimport type { ListSelectionState } from '../hooks/types';\n\ntype ListLayout = 'horizontal' | 'vertical' | 'grid';\n\nexport type ListSlots = {\n root: NonNullable<Slot<'ul', 'div' | 'ol'>>;\n};\n\n/**\n * List Props\n */\nexport type ListProps = ComponentProps<ListSlots> & {\n /**\n * Defines the layout orientation.\n *\n * @default vertical\n */\n layout?: ListLayout;\n\n /**\n * Defines if the list should be navigable. Set this to true when adding an `onClick` handler.\n *\n * @default false\n */\n navigable?: boolean;\n\n /**\n * Defines if the List items should be selectable.\n *\n * @default false\n */\n selectable?: boolean;\n\n /**\n * Defines selection mode for the List.\n *\n * @default single\n */\n selectionMode?: SelectionMode;\n\n /**\n * For controlled selection - defines selected items\n */\n selectedItems?: SelectionItemId[];\n\n /**\n * For uncontrolled selection - defines default selected items\n */\n defaultSelectedItems?: SelectionItemId[];\n\n /**\n * Callback for selection change events, used for both controlled and uncontrolled (as notification)\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onSelectionChange?: (event: React.SyntheticEvent, data: { selectedItems: SelectionItemId[] }) => void;\n\n /**\n * Truncates header\n *\n * @default false\n */\n truncateHeader?: boolean;\n\n /**\n * Truncates content\n *\n * @default false\n */\n truncateContent?: boolean;\n};\n\nexport type ListContextValue = {\n navigable: boolean;\n selection?: ListSelectionState;\n as?: 'div' | 'ol' | 'ul';\n truncateHeader?: ListProps['truncateHeader'];\n truncateContent?: ListProps['truncateContent'];\n};\n\nexport type ListContextValues = {\n listContext: ListContextValue;\n};\n\n/**\n * State used in rendering List\n */\nexport type ListState = ComponentState<ListSlots> & Required<Pick<ListProps, 'layout'>> & ListContextValue;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/List.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, SelectionMode, SelectionItemId } from '@fluentui/react-utilities';\nimport type { ListSelectionState } from '../hooks/types';\n\ntype ListLayout = 'horizontal' | 'vertical' | 'grid';\n\nexport type ListSlots = {\n root: NonNullable<Slot<'ul', 'div' | 'ol'>>;\n};\n\n/**\n * List Props\n */\nexport type ListProps = ComponentProps<ListSlots> & {\n /**\n * Defines the layout orientation.\n *\n * @default vertical\n */\n layout?: ListLayout;\n\n /**\n * Defines if the list should be navigable. Set this to true when adding an `onClick` handler.\n *\n * @default false\n */\n navigable?: boolean;\n\n /**\n * Defines if the List items should be selectable.\n *\n * @default false\n */\n selectable?: boolean;\n\n /**\n * Defines selection mode for the List.\n *\n * @default single\n */\n selectionMode?: SelectionMode;\n\n /**\n * For controlled selection - defines selected items\n */\n selectedItems?: SelectionItemId[];\n\n /**\n * For uncontrolled selection - defines default selected items\n */\n defaultSelectedItems?: SelectionItemId[];\n\n /**\n * Callback for selection change events, used for both controlled and uncontrolled (as notification)\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onSelectionChange?: (event: React.SyntheticEvent, data: { selectedItems: SelectionItemId[] }) => void;\n\n /**\n * Truncates header\n *\n * @default false\n */\n truncateHeader?: boolean;\n\n /**\n * Truncates content\n *\n * @default false\n */\n truncateContent?: boolean;\n};\n\nexport type ListContextValue = {\n navigable: boolean;\n selection?: ListSelectionState;\n as?: 'div' | 'ol' | 'ul';\n truncateHeader?: ListProps['truncateHeader'];\n truncateContent?: ListProps['truncateContent'];\n};\n\nexport type ListContextValues = {\n listContext: ListContextValue;\n};\n\n/**\n * State used in rendering List\n */\nexport type ListState = ComponentState<ListSlots> & Required<Pick<ListProps, 'layout'>> & ListContextValue;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './List';\nexport * from './List.types';\nexport * from './renderList';\nexport * from './useList';\nexport * from './useListStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/index.ts"],"sourcesContent":["export * from './List';\nexport * from './List.types';\nexport * from './renderList';\nexport * from './useList';\nexport * from './useListStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["listContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport { ListContextValue } from './List.types';\n\nexport const listContextDefaultValue: ListContextValue = {\n navigable: false,\n selection: undefined,\n as: undefined,\n};\n\nconst listContext = createContext<ListContextValue | undefined>(undefined);\n\nexport const ListContextProvider = listContext.Provider;\n\nexport const useListContext_unstable = <T>(selector: ContextSelector<ListContextValue, T>): T =>\n useContextSelector(listContext, (ctx = listContextDefaultValue) => selector(ctx));\n"],"names":["ListContextProvider","listContextDefaultValue","useListContext_unstable","navigable","selection","undefined","as","listContext","createContext","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,mBAAAA;eAAAA;;IARAC,uBAAAA;eAAAA;;IAUAC,uBAAAA;eAAAA;;;sCAdqC;AAI3C,MAAMD,0BAA4C;IACvDE,WAAW;IACXC,WAAWC;IACXC,IAAID;AACN;AAEA,MAAME,cAAcC,IAAAA,mCAAAA,EAA4CH;AAEzD,MAAML,sBAAsBO,YAAYE,QAAQ;AAEhD,MAAMP,0BAA0B,CAAIQ,WACzCC,IAAAA,wCAAAA,EAAmBJ,aAAa,CAACK,MAAMX,uBAAuB,GAAKS,SAASE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/listContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport { ListContextValue } from './List.types';\n\nexport const listContextDefaultValue: ListContextValue = {\n navigable: false,\n selection: undefined,\n as: undefined,\n};\n\nconst listContext = createContext<ListContextValue | undefined>(undefined);\n\nexport const ListContextProvider = listContext.Provider;\n\nexport const useListContext_unstable = <T>(selector: ContextSelector<ListContextValue, T>): T =>\n useContextSelector(listContext, (ctx = listContextDefaultValue) => selector(ctx));\n"],"names":["ListContextProvider","listContextDefaultValue","useListContext_unstable","navigable","selection","undefined","as","listContext","createContext","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,mBAAAA;eAAAA;;IARAC,uBAAAA;eAAAA;;IAUAC,uBAAAA;eAAAA;;;sCAdqC;AAI3C,MAAMD,0BAA4C;IACvDE,WAAW;IACXC,WAAWC;IACXC,IAAID;AACN;AAEA,MAAME,cAAcC,IAAAA,mCAAAA,EAA4CH;AAEzD,MAAML,sBAAsBO,YAAYE,QAAQ;AAEhD,MAAMP,0BAA0B,CAAIQ,WACzCC,IAAAA,wCAAAA,EAAmBJ,aAAa,CAACK,MAAMX,uBAAuB,GAAKS,SAASE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ListState, ListSlots, ListContextValues } from './List.types';\nimport { ListContextProvider } from './listContext';\n\n/**\n * Render the final JSX of List\n */\nexport const renderList_unstable = (state: ListState, contextValues: ListContextValues) => {\n assertSlots<ListSlots>(state);\n\n return (\n <ListContextProvider value={contextValues.listContext}>\n <state.root />\n </ListContextProvider>\n );\n};\n"],"names":["renderList_unstable","state","contextValues","assertSlots","_jsx","ListContextProvider","value","listContext","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;gCAE4B;6BAEQ;AAK7B,MAAMA,sBAAsB,CAACC,OAAkBC;IACpDC,IAAAA,2BAAAA,EAAuBF;IAEvB,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,gCAAAA,EAAAA;QAAoBC,OAAOJ,cAAcK,WAAW;kBACnD,WAAA,GAAAH,IAAAA,eAAA,EAACH,MAAMO,IAAI,EAAA,CAAA;;AAGjB"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/renderList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ListState, ListSlots, ListContextValues } from './List.types';\nimport { ListContextProvider } from './listContext';\n\n/**\n * Render the final JSX of List\n */\nexport const renderList_unstable = (state: ListState, contextValues: ListContextValues) => {\n assertSlots<ListSlots>(state);\n\n return (\n <ListContextProvider value={contextValues.listContext}>\n <state.root />\n </ListContextProvider>\n );\n};\n"],"names":["renderList_unstable","state","contextValues","assertSlots","_jsx","ListContextProvider","value","listContext","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;gCAE4B;6BAEQ;AAK7B,MAAMA,sBAAsB,CAACC,OAAkBC;IACpDC,IAAAA,2BAAAA,EAAuBF;IAEvB,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,gCAAAA,EAAAA;QAAoBC,OAAOJ,cAAcK,WAAW;kBACnD,WAAA,GAAAH,IAAAA,eAAA,EAACH,MAAMO,IAAI,EAAA,CAAA;;AAGjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n OnSelectionChangeData,\n slot,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { ListProps, ListState } from './List.types';\nimport { useListSelection } from '../hooks/useListSelection';\n\nconst DEFAULT_ROOT_EL_TYPE = 'ul';\n\n/**\n * Create the state required to render List.\n *\n * The returned state can be modified with hooks such as useListStyles_unstable,\n * before being passed to renderList_unstable.\n *\n * @param props - props from this instance of List\n * @param ref - reference to root HTMLElement of List\n */\nexport const useList_unstable = (props: ListProps, ref: React.Ref<HTMLDivElement | HTMLUListElement>): ListState => {\n const {\n layout = 'vertical',\n navigable = false,\n selectable = false,\n selectionMode = 'single',\n selectedItems,\n defaultSelectedItems,\n as,\n onSelectionChange,\n truncateContent = false,\n truncateHeader = false,\n } = props;\n\n const arrowNavigationAttributes = useArrowNavigationGroup({\n axis: layout === 'grid' ? 'grid-linear' : 'both',\n memorizeCurrent: true,\n });\n\n const [selectionState, setSelectionState] = useControllableState({\n state: selectedItems,\n defaultState: defaultSelectedItems,\n initialState: [],\n });\n\n const onChange = useEventCallback((e: React.SyntheticEvent, data: OnSelectionChangeData) => {\n const selectedItemsAsArray = Array.from(data.selectedItems);\n setSelectionState(selectedItemsAsArray);\n onSelectionChange?.(e, { selectedItems: selectedItemsAsArray });\n });\n\n const selection = useListSelection({\n onSelectionChange: onChange,\n selectionMode,\n selectedItems: selectionState,\n defaultSelectedItems,\n });\n\n return {\n components: {\n root: DEFAULT_ROOT_EL_TYPE,\n },\n root: slot.always(\n getIntrinsicElementProps(DEFAULT_ROOT_EL_TYPE, {\n ref,\n ...(navigable && { role: 'menu' }),\n ...(selectable && {\n role: 'listbox',\n 'aria-multiselectable': selectionMode === 'multiselect' ? true : undefined,\n }),\n ...arrowNavigationAttributes,\n ...props,\n }),\n { elementType: DEFAULT_ROOT_EL_TYPE },\n ),\n layout,\n // context:\n navigable,\n as: as || DEFAULT_ROOT_EL_TYPE,\n truncateContent,\n truncateHeader,\n // only pass down selection state if its handled internally, otherwise just report the events\n selection: selectable ? selection : undefined,\n };\n};\n"],"names":["useList_unstable","DEFAULT_ROOT_EL_TYPE","props","ref","layout","navigable","selectable","selectionMode","selectedItems","defaultSelectedItems","as","onSelectionChange","truncateContent","truncateHeader","arrowNavigationAttributes","useArrowNavigationGroup","axis","memorizeCurrent","selectionState","setSelectionState","useControllableState","state","defaultState","initialState","onChange","useEventCallback","e","data","selectedItemsAsArray","Array","from","selection","useListSelection","components","root","slot","always","getIntrinsicElementProps","role","undefined","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;gCAOhB;8BACiC;kCAEP;AAEjC,MAAMC,uBAAuB;AAWtB,MAAMD,mBAAmB,CAACE,OAAkBC;IACjD,MAAM,EACJC,SAAS,UAAU,EACnBC,YAAY,KAAK,EACjBC,aAAa,KAAK,EAClBC,gBAAgB,QAAQ,EACxBC,aAAa,EACbC,oBAAoB,EACpBC,EAAE,EACFC,iBAAiB,EACjBC,kBAAkB,KAAK,EACvBC,iBAAiB,KAAK,EACvB,GAAGX;IAEJ,MAAMY,4BAA4BC,IAAAA,qCAAAA,EAAwB;QACxDC,MAAMZ,WAAW,SAAS,gBAAgB;QAC1Ca,iBAAiB;IACnB;IAEA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,IAAAA,oCAAAA,EAAqB;QAC/DC,OAAOb;QACPc,cAAcb;QACdc,cAAc,EAAE;IAClB;IAEA,MAAMC,WAAWC,IAAAA,gCAAAA,EAAiB,CAACC,GAAyBC;QAC1D,MAAMC,uBAAuBC,MAAMC,IAAI,CAACH,KAAKnB,aAAa;QAC1DW,kBAAkBS;QAClBjB,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAoBe,GAAG;YAAElB,eAAeoB;QAAqB;IAC/D;IAEA,MAAMG,YAAYC,IAAAA,kCAAAA,EAAiB;QACjCrB,mBAAmBa;QACnBjB;QACAC,eAAeU;QACfT;IACF;IAEA,OAAO;QACLwB,YAAY;YACVC,MAAMjC;QACR;QACAiC,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyBpC,sBAAsB;YAC7CE;YACA,GAAIE,aAAa;gBAAEiC,MAAM;YAAO,CAAC;YACjC,GAAIhC,cAAc;gBAChBgC,MAAM;gBACN,wBAAwB/B,kBAAkB,gBAAgB,OAAOgC;YACnE,CAAC;YACD,GAAGzB,yBAAyB;YAC5B,GAAGZ,KAAK;QACV,IACA;YAAEsC,aAAavC;QAAqB;QAEtCG;QACA,WAAW;QACXC;QACAK,IAAIA,MAAMT;QACVW;QACAC;QACA,6FAA6F;QAC7FkB,WAAWzB,aAAayB,YAAYQ;IACtC;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/useList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n OnSelectionChangeData,\n slot,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { ListProps, ListState } from './List.types';\nimport { useListSelection } from '../hooks/useListSelection';\n\nconst DEFAULT_ROOT_EL_TYPE = 'ul';\n\n/**\n * Create the state required to render List.\n *\n * The returned state can be modified with hooks such as useListStyles_unstable,\n * before being passed to renderList_unstable.\n *\n * @param props - props from this instance of List\n * @param ref - reference to root HTMLElement of List\n */\nexport const useList_unstable = (props: ListProps, ref: React.Ref<HTMLDivElement | HTMLUListElement>): ListState => {\n const {\n layout = 'vertical',\n navigable = false,\n selectable = false,\n selectionMode = 'single',\n selectedItems,\n defaultSelectedItems,\n as,\n onSelectionChange,\n truncateContent = false,\n truncateHeader = false,\n } = props;\n\n const arrowNavigationAttributes = useArrowNavigationGroup({\n axis: layout === 'grid' ? 'grid-linear' : 'both',\n memorizeCurrent: true,\n });\n\n const [selectionState, setSelectionState] = useControllableState({\n state: selectedItems,\n defaultState: defaultSelectedItems,\n initialState: [],\n });\n\n const onChange = useEventCallback((e: React.SyntheticEvent, data: OnSelectionChangeData) => {\n const selectedItemsAsArray = Array.from(data.selectedItems);\n setSelectionState(selectedItemsAsArray);\n onSelectionChange?.(e, { selectedItems: selectedItemsAsArray });\n });\n\n const selection = useListSelection({\n onSelectionChange: onChange,\n selectionMode,\n selectedItems: selectionState,\n defaultSelectedItems,\n });\n\n return {\n components: {\n root: DEFAULT_ROOT_EL_TYPE,\n },\n root: slot.always(\n getIntrinsicElementProps(DEFAULT_ROOT_EL_TYPE, {\n ref,\n ...(navigable && { role: 'menu' }),\n ...(selectable && {\n role: 'listbox',\n 'aria-multiselectable': selectionMode === 'multiselect' ? true : undefined,\n }),\n ...arrowNavigationAttributes,\n ...props,\n }),\n { elementType: DEFAULT_ROOT_EL_TYPE },\n ),\n layout,\n // context:\n navigable,\n as: as || DEFAULT_ROOT_EL_TYPE,\n truncateContent,\n truncateHeader,\n // only pass down selection state if its handled internally, otherwise just report the events\n selection: selectable ? selection : undefined,\n };\n};\n"],"names":["useList_unstable","DEFAULT_ROOT_EL_TYPE","props","ref","layout","navigable","selectable","selectionMode","selectedItems","defaultSelectedItems","as","onSelectionChange","truncateContent","truncateHeader","arrowNavigationAttributes","useArrowNavigationGroup","axis","memorizeCurrent","selectionState","setSelectionState","useControllableState","state","defaultState","initialState","onChange","useEventCallback","e","data","selectedItemsAsArray","Array","from","selection","useListSelection","components","root","slot","always","getIntrinsicElementProps","role","undefined","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;gCAOhB;8BACiC;kCAEP;AAEjC,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7FkB,WAAWzB,aAAayB,YAAYQ;IACtC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useListContextValues.ts"],"sourcesContent":["import { ListContextValues, ListState } from './List.types';\n\nexport function useListContextValues_unstable(state: ListState): ListContextValues {\n const { navigable, selection, as, truncateContent, truncateHeader } = state;\n\n const listContext = {\n navigable,\n selection,\n as,\n truncateContent,\n truncateHeader,\n };\n\n return {\n listContext,\n };\n}\n"],"names":["useListContextValues_unstable","state","navigable","selection","as","truncateContent","truncateHeader","listContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,8BAA8BC,KAAgB;IAC5D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,EAAE,EAAEC,eAAe,EAAEC,cAAc,EAAE,GAAGL;IAEtE,MAAMM,cAAc;QAClBL;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,OAAO;QACLC;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/List/useListContextValues.ts"],"sourcesContent":["import { ListContextValues, ListState } from './List.types';\n\nexport function useListContextValues_unstable(state: ListState): ListContextValues {\n const { navigable, selection, as, truncateContent, truncateHeader } = state;\n\n const listContext = {\n navigable,\n selection,\n as,\n truncateContent,\n truncateHeader,\n };\n\n return {\n listContext,\n };\n}\n"],"names":["useListContextValues_unstable","state","navigable","selection","as","truncateContent","truncateHeader","listContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,8BAA8BC,KAAgB;IAC5D,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,EAAE,EAAEC,eAAe,EAAEC,cAAc,EAAE,GAAGL;IAEtE,MAAMM,cAAc;QAClBL;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,OAAO;QACLC;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ListItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useListItem_unstable } from './useListItem';\nimport { renderListItem_unstable } from './renderListItem';\nimport { useListItemStyles_unstable } from './useListItemStyles.styles';\nimport type { ListItemProps } from './ListItem.types';\n\nexport const ListItem: ForwardRefComponent<ListItemProps> = React.forwardRef<HTMLLIElement | HTMLDivElement>(\n (props, ref) => {\n const state = useListItem_unstable(props, ref);\n\n useListItemStyles_unstable(state);\n useCustomStyleHook_unstable('useListItemStyles_unstable')(state);\n return renderListItem_unstable(state);\n },\n);\n\nListItem.displayName = 'ListItem';\n"],"names":["ListItem","React","forwardRef","props","ref","state","useListItem_unstable","useListItemStyles_unstable","useCustomStyleHook_unstable","renderListItem_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEqB;6BACP;gCACG;yCACG;AAGpC,MAAMA,WAAAA,WAAAA,GAA+CC,OAAMC,UAAU,CAC1E,CAACC,OAAOC;IACN,MAAMC,QAAQC,IAAAA,iCAAAA,EAAqBH,OAAOC;IAE1CG,IAAAA,mDAAAA,EAA2BF;IAC3BG,IAAAA,gDAAAA,EAA4B,8BAA8BH;IAC1D,OAAOI,IAAAA,uCAAAA,EAAwBJ;AACjC;AAGFL,SAASU,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/ListItem/ListItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useListItem_unstable } from './useListItem';\nimport { renderListItem_unstable } from './renderListItem';\nimport { useListItemStyles_unstable } from './useListItemStyles.styles';\nimport type { ListItemProps } from './ListItem.types';\n\nexport const ListItem: ForwardRefComponent<ListItemProps> = React.forwardRef<HTMLLIElement | HTMLDivElement>(\n (props, ref) => {\n const state = useListItem_unstable(props, ref);\n\n useListItemStyles_unstable(state);\n useCustomStyleHook_unstable('useListItemStyles_unstable')(state);\n return renderListItem_unstable(state);\n },\n);\n\nListItem.displayName = 'ListItem';\n"],"names":["ListItem","React","forwardRef","props","ref","state","useListItem_unstable","useListItemStyles_unstable","useCustomStyleHook_unstable","renderListItem_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEqB;6BACP;gCACG;yCACG;AAGpC,MAAMA,WAAAA,WAAAA,GAA+CC,OAAMC,UAAU,CAC1E,CAACC,OAAOC;IACN,MAAMC,QAAQC,IAAAA,iCAAAA,EAAqBH,OAAOC;IAE1CG,IAAAA,mDAAAA,EAA2BF;IAC3BG,IAAAA,gDAAAA,EAA4B,8BAA8BH;IAC1D,OAAOI,IAAAA,uCAAAA,EAAwBJ;AACjC;AAGFL,SAASU,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ListItem.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ItemLayout } from '../../ItemLayout';\n\nexport type ListItemSlots = {\n root: NonNullable<Slot<'li', 'div'>>;\n media?: React.ComponentProps<typeof ItemLayout>['startMedia'];\n header?: React.ComponentProps<typeof ItemLayout>['header'];\n contentWrapper?: React.ComponentProps<typeof ItemLayout>['contentWrapper'];\n headerMedia?: React.ComponentProps<typeof ItemLayout>['headerMedia'];\n contentMedia?: React.ComponentProps<typeof ItemLayout>['contentMedia'];\n endMedia?: React.ComponentProps<typeof ItemLayout>['endMedia'];\n};\n\n/**\n * ListItem Props\n */\nexport type ListItemProps = ComponentProps<ListItemSlots> & {\n value?: string | number;\n truncateHeader?: boolean;\n truncateContent?: boolean;\n};\n\n/**\n * State used in rendering ListItem\n */\nexport type ListItemState = ComponentState<ListItemSlots> & {\n selectable?: boolean;\n selected?: boolean;\n navigable?: boolean;\n truncateHeader?: boolean;\n truncateContent?: boolean;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/ListItem/ListItem.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ItemLayout } from '../../ItemLayout';\n\nexport type ListItemSlots = {\n root: NonNullable<Slot<'li', 'div'>>;\n media?: React.ComponentProps<typeof ItemLayout>['startMedia'];\n header?: React.ComponentProps<typeof ItemLayout>['header'];\n contentWrapper?: React.ComponentProps<typeof ItemLayout>['contentWrapper'];\n headerMedia?: React.ComponentProps<typeof ItemLayout>['headerMedia'];\n contentMedia?: React.ComponentProps<typeof ItemLayout>['contentMedia'];\n endMedia?: React.ComponentProps<typeof ItemLayout>['endMedia'];\n};\n\n/**\n * ListItem Props\n */\nexport type ListItemProps = ComponentProps<ListItemSlots> & {\n value?: string | number;\n truncateHeader?: boolean;\n truncateContent?: boolean;\n};\n\n/**\n * State used in rendering ListItem\n */\nexport type ListItemState = ComponentState<ListItemSlots> & {\n selectable?: boolean;\n selected?: boolean;\n navigable?: boolean;\n truncateHeader?: boolean;\n truncateContent?: boolean;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ListItem';\nexport * from './ListItem.types';\nexport * from './renderListItem';\nexport * from './useListItem';\nexport * from './useListItemStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/ListItem/index.ts"],"sourcesContent":["export * from './ListItem';\nexport * from './ListItem.types';\nexport * from './renderListItem';\nexport * from './useListItem';\nexport * from './useListItemStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderListItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { ItemLayout } from '../../ItemLayout';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ListItemSlots, ListItemState } from './ListItem.types';\n/**\n * Render the final JSX of ListItem\n */\nexport const renderListItem_unstable = (state: ListItemState) => {\n assertSlots<ListItemSlots>(state);\n\n return (\n <state.root>\n <ItemLayout\n startMedia={state.media}\n header={state.header}\n headerMedia={state.headerMedia}\n contentWrapper={state.contentWrapper}\n contentMedia={state.contentMedia}\n endMedia={state.endMedia}\n >\n {state.root.children}\n </ItemLayout>\n </state.root>\n );\n};\n"],"names":["renderListItem_unstable","state","assertSlots","_jsx","root","ItemLayout","startMedia","media","header","headerMedia","contentWrapper","contentMedia","endMedia","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;4BAE2B;gCACC;AAKrB,MAAMA,0BAA0B,CAACC;IACtCC,IAAAA,2BAAAA,EAA2BD;IAE3B,OAAA,WAAA,GACEE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA;kBACT,WAAA,GAAAD,IAAAA,eAAA,EAACE,sBAAAA,EAAAA;YACCC,YAAYL,MAAMM,KAAK;YACvBC,QAAQP,MAAMO,MAAM;YACpBC,aAAaR,MAAMQ,WAAW;YAC9BC,gBAAgBT,MAAMS,cAAc;YACpCC,cAAcV,MAAMU,YAAY;YAChCC,UAAUX,MAAMW,QAAQ;sBAEvBX,MAAMG,IAAI,CAACS,QAAQ;;;AAI5B"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/ListItem/renderListItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { ItemLayout } from '../../ItemLayout';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ListItemSlots, ListItemState } from './ListItem.types';\n/**\n * Render the final JSX of ListItem\n */\nexport const renderListItem_unstable = (state: ListItemState) => {\n assertSlots<ListItemSlots>(state);\n\n return (\n <state.root>\n <ItemLayout\n startMedia={state.media}\n header={state.header}\n headerMedia={state.headerMedia}\n contentWrapper={state.contentWrapper}\n contentMedia={state.contentMedia}\n endMedia={state.endMedia}\n >\n {state.root.children}\n </ItemLayout>\n </state.root>\n );\n};\n"],"names":["renderListItem_unstable","state","assertSlots","_jsx","root","ItemLayout","startMedia","media","header","headerMedia","contentWrapper","contentMedia","endMedia","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;4BAE2B;gCACC;AAKrB,MAAMA,0BAA0B,CAACC;IACtCC,IAAAA,2BAAAA,EAA2BD;IAE3B,OAAA,WAAA,GACEE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA;kBACT,WAAA,GAAAD,IAAAA,eAAA,EAACE,sBAAAA,EAAAA;YACCC,YAAYL,MAAMM,KAAK;YACvBC,QAAQP,MAAMO,MAAM;YACpBC,aAAaR,MAAMQ,WAAW;YAC9BC,gBAAgBT,MAAMS,cAAc;YACpCC,cAAcV,MAAMU,YAAY;YAChCC,UAAUX,MAAMW,QAAQ;sBAEvBX,MAAMG,IAAI,CAACS,QAAQ;;;AAI5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useListItem.tsx"],"sourcesContent":["import { useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot, useEventCallback, useId } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useListContext_unstable } from '../List/listContext';\nimport type { ListItemProps, ListItemState } from './ListItem.types';\n\nconst DEFAULT_ROOT_EL_TYPE = 'li';\n\nfunction validateProperElementTypes(parentRenderedAs?: 'div' | 'ul' | 'ol', renderedAs?: 'div' | 'li') {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n if (renderedAs === 'div' && parentRenderedAs !== 'div') {\n throw new Error('ListItem cannot be rendered as a div when its parent is not a div.');\n }\n if (renderedAs === 'li' && parentRenderedAs === 'div') {\n throw new Error('ListItem cannot be rendered as a li when its parent is a div.');\n }\n}\n\nfunction validateNavigableWhenOnClickPresent(navigable: boolean, onClick?: React.MouseEventHandler) {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n if (onClick && !navigable) {\n throw new Error('ListItem must be navigable when onClick is present. Set navigable={true} on the List.');\n }\n}\n\n/**\n * Create the state required to render ListItem.\n *\n * The returned state can be modified with hooks such as useListItemStyles_unstable,\n * before being passed to renderListItem_unstable.\n *\n * @param props - props from this instance of ListItem\n * @param ref - reference to root HTMLLIElement | HTMLDivElementof ListItem\n */\nexport const useListItem_unstable = (\n props: ListItemProps,\n ref: React.Ref<HTMLLIElement | HTMLDivElement>,\n): ListItemState => {\n const id = useId('listItem');\n const { value = id, truncateHeader, truncateContent, onClick, onKeyDown, onKeyUp } = props;\n\n const navigable = useListContext_unstable(ctx => ctx.navigable);\n const toggleItem = useListContext_unstable(ctx => ctx.selection?.toggleItem);\n const isSelectionEnabled = useListContext_unstable(ctx => !!ctx.selection);\n const isSelected = useListContext_unstable(ctx => ctx.selection?.isSelected(value));\n\n const truncateHeaderOnList = useListContext_unstable(ctx => ctx.truncateHeader);\n const truncateContentOnList = useListContext_unstable(ctx => ctx.truncateContent);\n\n const parentRenderedAs = useListContext_unstable(ctx => ctx.as);\n const renderedAs = props.as || DEFAULT_ROOT_EL_TYPE;\n\n validateProperElementTypes(parentRenderedAs, renderedAs);\n\n validateNavigableWhenOnClickPresent(navigable, onClick);\n\n const handleClick: React.MouseEventHandler<HTMLLIElement & HTMLDivElement> = useEventCallback(e => {\n onClick?.(e);\n\n if (!isSelectionEnabled || e.defaultPrevented) {\n return;\n }\n\n toggleItem?.(e, value);\n });\n\n // avoid passing empty onClick to prevent items unnecessary being narrated as clickable\n // see https://github.com/microsoft/fluentui/issues/20658\n const passClickHandler = !!onClick || isSelectionEnabled;\n\n const clickHandlerProps = {\n onClick: passClickHandler ? handleClick : undefined,\n onKeyDown: onKeyDown as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n onKeyUp: onKeyUp as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n };\n\n // This will give us the onKeyDown and onKeyUp props for Enter and Space\n const ariaButtonProps = useARIAButtonProps('div', clickHandlerProps);\n\n // v0 ListItem adds keyboard handling only for navigable or selectable items\n const buttonProps = navigable || isSelectionEnabled ? ariaButtonProps : clickHandlerProps;\n\n const root = slot.always(\n getIntrinsicElementProps(DEFAULT_ROOT_EL_TYPE, {\n ref: ref as React.Ref<HTMLLIElement & HTMLDivElement>,\n tabIndex: navigable || isSelectionEnabled ? 0 : undefined,\n role: navigable ? 'menuitem' : 'listitem',\n id: String(value),\n ...(isSelectionEnabled && {\n role: 'option',\n 'aria-selected': isSelected,\n }),\n ...props,\n onKeyDown: buttonProps.onKeyDown as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n onKeyUp: buttonProps.onKeyUp as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n onClick: buttonProps.onClick as React.MouseEventHandler<HTMLLIElement & HTMLDivElement>,\n }),\n { elementType: DEFAULT_ROOT_EL_TYPE },\n );\n\n const state: ListItemState = {\n components: {\n root: DEFAULT_ROOT_EL_TYPE,\n media: 'div',\n header: 'div',\n contentWrapper: 'div',\n headerMedia: 'div',\n contentMedia: 'div',\n endMedia: 'div',\n },\n root,\n navigable,\n selectable: isSelectionEnabled,\n selected: isSelected,\n media: slot.optional(props.media, { elementType: 'div' }),\n header: slot.optional(props.header, { elementType: 'div' }),\n contentWrapper: slot.optional(props.contentWrapper, { elementType: 'div', renderByDefault: true }),\n headerMedia: slot.optional(props.headerMedia, { elementType: 'div' }),\n contentMedia: slot.optional(props.contentMedia, { elementType: 'div' }),\n endMedia: slot.optional(props.endMedia, { elementType: 'div' }),\n truncateHeader: truncateHeader ?? truncateHeaderOnList,\n truncateContent: truncateContent ?? truncateContentOnList,\n };\n\n return state;\n};\n"],"names":["useListItem_unstable","DEFAULT_ROOT_EL_TYPE","validateProperElementTypes","parentRenderedAs","renderedAs","process","env","NODE_ENV","Error","validateNavigableWhenOnClickPresent","navigable","onClick","props","ref","id","useId","value","truncateHeader","truncateContent","onKeyDown","onKeyUp","useListContext_unstable","ctx","toggleItem","selection","isSelectionEnabled","isSelected","truncateHeaderOnList","truncateContentOnList","as","handleClick","useEventCallback","e","defaultPrevented","passClickHandler","clickHandlerProps","undefined","ariaButtonProps","useARIAButtonProps","buttonProps","root","slot","always","getIntrinsicElementProps","tabIndex","role","String","elementType","state","components","media","header","contentWrapper","headerMedia","contentMedia","endMedia","selectable","selected","optional","renderByDefault"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwCaA;;;eAAAA;;;;2BAxCsB;gCACqC;iEACjD;6BACiB;AAGxC,MAAMC,uBAAuB;AAE7B,SAASC,2BAA2BC,gBAAsC,EAAEC,UAAyB;IACnG,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC;IACF;IAEA,IAAIH,eAAe,SAASD,qBAAqB,OAAO;QACtD,MAAM,IAAIK,MAAM;IAClB;IACA,IAAIJ,eAAe,QAAQD,qBAAqB,OAAO;QACrD,MAAM,IAAIK,MAAM;IAClB;AACF;AAEA,SAASC,oCAAoCC,SAAkB,EAAEC,OAAiC;IAChG,IAAIN,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC;IACF;IAEA,IAAII,WAAW,CAACD,WAAW;QACzB,MAAM,IAAIF,MAAM;IAClB;AACF;AAWO,MAAMR,uBAAuB,CA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AAW,EAAE;YAAEN,aAAa;QAAM;QACnEO,cAAcb,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAM0C,YAAY,EAAE;YAAEP,aAAa;QAAM;QACrEQ,UAAUd,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAM2C,QAAQ,EAAE;YAAER,aAAa;QAAM;QAC7D9B,gBAAgBA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkBU;QAClCT,iBAAiBA,oBAAAA,QAAAA,oBAAAA,KAAAA,IAAAA,kBAAmBU;IACtC;IAEA,OAAOoB;AACT"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/ListItem/useListItem.tsx"],"sourcesContent":["import { useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot, useEventCallback, useId } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useListContext_unstable } from '../List/listContext';\nimport type { ListItemProps, ListItemState } from './ListItem.types';\n\nconst DEFAULT_ROOT_EL_TYPE = 'li';\n\nfunction validateProperElementTypes(parentRenderedAs?: 'div' | 'ul' | 'ol', renderedAs?: 'div' | 'li') {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n if (renderedAs === 'div' && parentRenderedAs !== 'div') {\n throw new Error('ListItem cannot be rendered as a div when its parent is not a div.');\n }\n if (renderedAs === 'li' && parentRenderedAs === 'div') {\n throw new Error('ListItem cannot be rendered as a li when its parent is a div.');\n }\n}\n\nfunction validateNavigableWhenOnClickPresent(navigable: boolean, onClick?: React.MouseEventHandler) {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n if (onClick && !navigable) {\n throw new Error('ListItem must be navigable when onClick is present. Set navigable={true} on the List.');\n }\n}\n\n/**\n * Create the state required to render ListItem.\n *\n * The returned state can be modified with hooks such as useListItemStyles_unstable,\n * before being passed to renderListItem_unstable.\n *\n * @param props - props from this instance of ListItem\n * @param ref - reference to root HTMLLIElement | HTMLDivElementof ListItem\n */\nexport const useListItem_unstable = (\n props: ListItemProps,\n ref: React.Ref<HTMLLIElement | HTMLDivElement>,\n): ListItemState => {\n const id = useId('listItem');\n const { value = id, truncateHeader, truncateContent, onClick, onKeyDown, onKeyUp } = props;\n\n const navigable = useListContext_unstable(ctx => ctx.navigable);\n const toggleItem = useListContext_unstable(ctx => ctx.selection?.toggleItem);\n const isSelectionEnabled = useListContext_unstable(ctx => !!ctx.selection);\n const isSelected = useListContext_unstable(ctx => ctx.selection?.isSelected(value));\n\n const truncateHeaderOnList = useListContext_unstable(ctx => ctx.truncateHeader);\n const truncateContentOnList = useListContext_unstable(ctx => ctx.truncateContent);\n\n const parentRenderedAs = useListContext_unstable(ctx => ctx.as);\n const renderedAs = props.as || DEFAULT_ROOT_EL_TYPE;\n\n validateProperElementTypes(parentRenderedAs, renderedAs);\n\n validateNavigableWhenOnClickPresent(navigable, onClick);\n\n const handleClick: React.MouseEventHandler<HTMLLIElement & HTMLDivElement> = useEventCallback(e => {\n onClick?.(e);\n\n if (!isSelectionEnabled || e.defaultPrevented) {\n return;\n }\n\n toggleItem?.(e, value);\n });\n\n // avoid passing empty onClick to prevent items unnecessary being narrated as clickable\n // see https://github.com/microsoft/fluentui/issues/20658\n const passClickHandler = !!onClick || isSelectionEnabled;\n\n const clickHandlerProps = {\n onClick: passClickHandler ? handleClick : undefined,\n onKeyDown: onKeyDown as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n onKeyUp: onKeyUp as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n };\n\n // This will give us the onKeyDown and onKeyUp props for Enter and Space\n const ariaButtonProps = useARIAButtonProps('div', clickHandlerProps);\n\n // v0 ListItem adds keyboard handling only for navigable or selectable items\n const buttonProps = navigable || isSelectionEnabled ? ariaButtonProps : clickHandlerProps;\n\n const root = slot.always(\n getIntrinsicElementProps(DEFAULT_ROOT_EL_TYPE, {\n ref: ref as React.Ref<HTMLLIElement & HTMLDivElement>,\n tabIndex: navigable || isSelectionEnabled ? 0 : undefined,\n role: navigable ? 'menuitem' : 'listitem',\n id: String(value),\n ...(isSelectionEnabled && {\n role: 'option',\n 'aria-selected': isSelected,\n }),\n ...props,\n onKeyDown: buttonProps.onKeyDown as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n onKeyUp: buttonProps.onKeyUp as React.KeyboardEventHandler<HTMLLIElement & HTMLDivElement>,\n onClick: buttonProps.onClick as React.MouseEventHandler<HTMLLIElement & HTMLDivElement>,\n }),\n { elementType: DEFAULT_ROOT_EL_TYPE },\n );\n\n const state: ListItemState = {\n components: {\n root: DEFAULT_ROOT_EL_TYPE,\n media: 'div',\n header: 'div',\n contentWrapper: 'div',\n headerMedia: 'div',\n contentMedia: 'div',\n endMedia: 'div',\n },\n root,\n navigable,\n selectable: isSelectionEnabled,\n selected: isSelected,\n media: slot.optional(props.media, { elementType: 'div' }),\n header: slot.optional(props.header, { elementType: 'div' }),\n contentWrapper: slot.optional(props.contentWrapper, { elementType: 'div', renderByDefault: true }),\n headerMedia: slot.optional(props.headerMedia, { elementType: 'div' }),\n contentMedia: slot.optional(props.contentMedia, { elementType: 'div' }),\n endMedia: slot.optional(props.endMedia, { elementType: 'div' }),\n truncateHeader: truncateHeader ?? truncateHeaderOnList,\n truncateContent: truncateContent ?? truncateContentOnList,\n };\n\n return state;\n};\n"],"names":["useListItem_unstable","DEFAULT_ROOT_EL_TYPE","validateProperElementTypes","parentRenderedAs","renderedAs","process","env","NODE_ENV","Error","validateNavigableWhenOnClickPresent","navigable","onClick","props","ref","id","useId","value","truncateHeader","truncateContent","onKeyDown","onKeyUp","useListContext_unstable","ctx","toggleItem","selection","isSelectionEnabled","isSelected","truncateHeaderOnList","truncateContentOnList","as","handleClick","useEventCallback","e","defaultPrevented","passClickHandler","clickHandlerProps","undefined","ariaButtonProps","useARIAButtonProps","buttonProps","root","slot","always","getIntrinsicElementProps","tabIndex","role","String","elementType","state","components","media","header","contentWrapper","headerMedia","contentMedia","endMedia","selectable","selected","optional","renderByDefault"],"rangeMappings":";;;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YACN,iBAAiBnB;QACnB,CAAC;QACD,GAAGd,KAAK;QACRO,WAAWoB,YAAYpB,SAAS;QAChCC,SAASmB,YAAYnB,OAAO;QAC5BT,SAAS4B,YAAY5B,OAAO;IAC9B,IACA;QAAEoC,aAAa9C;IAAqB;IAGtC,MAAM+C,QAAuB;QAC3BC,YAAY;YACVT,MAAMvC;YACNiD,OAAO;YACPC,QAAQ;YACRC,gBAAgB;YAChBC,aAAa;YACbC,cAAc;YACdC,UAAU;QACZ;QACAf;QACA9B;QACA8C,YAAY/B;QACZgC,UAAU/B;QACVwB,OAAOT,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAMsC,KAAK,EAAE;YAAEH,aAAa;QAAM;QACvDI,QAAQV,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAMuC,MAAM,EAAE;YAAEJ,aAAa;QAAM;QACzDK,gBAAgBX,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAMwC,cAAc,EAAE;YAAEL,aAAa;YAAOY,iBAAiB;QAAK;QAChGN,aAAaZ,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAMyC,WAAW,EAAE;YAAEN,aAAa;QAAM;QACnEO,cAAcb,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAM0C,YAAY,EAAE;YAAEP,aAAa;QAAM;QACrEQ,UAAUd,oBAAAA,CAAKiB,QAAQ,CAAC9C,MAAM2C,QAAQ,EAAE;YAAER,aAAa;QAAM;QAC7D9B,gBAAgBA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkBU;QAClCT,iBAAiBA,oBAAAA,QAAAA,oBAAAA,KAAAA,IAAAA,kBAAmBU;IACtC;IAEA,OAAOoB;AACT"}
|
|
@@ -86,4 +86,4 @@ const useListItemStyles_unstable = (state)=>{
|
|
|
86
86
|
state.contentWrapper.className = (0, _react.mergeClasses)(styles.contentWrapper, state.truncateContent && styles.truncate, !state.contentMedia && styles.contentWrapperWithoutMedia, (_state_contentWrapper = state.contentWrapper) === null || _state_contentWrapper === void 0 ? void 0 : _state_contentWrapper.className);
|
|
87
87
|
}
|
|
88
88
|
return state;
|
|
89
|
-
};
|
|
89
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useListSelection';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/hooks/index.ts"],"sourcesContent":["export * from './useListSelection';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["types.ts"],"sourcesContent":["import { SelectionItemId } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type ListSelectionState = {\n isSelected: (item: string | number) => boolean;\n toggleItem: (e: React.SyntheticEvent, id: string | number) => void;\n deselectItem: (e: React.SyntheticEvent, id: string | number) => void;\n selectItem: (e: React.SyntheticEvent, id: string | number) => void;\n clearSelection: (e: React.SyntheticEvent) => void;\n toggleAllItems: (e: React.SyntheticEvent, itemIds: string[] | number[]) => void;\n setSelectedItems: React.Dispatch<React.SetStateAction<Iterable<SelectionItemId>>>;\n selectedItems: SelectionItemId[];\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEACuB"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/hooks/types.ts"],"sourcesContent":["import { SelectionItemId } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type ListSelectionState = {\n isSelected: (item: string | number) => boolean;\n toggleItem: (e: React.SyntheticEvent, id: string | number) => void;\n deselectItem: (e: React.SyntheticEvent, id: string | number) => void;\n selectItem: (e: React.SyntheticEvent, id: string | number) => void;\n clearSelection: (e: React.SyntheticEvent) => void;\n toggleAllItems: (e: React.SyntheticEvent, itemIds: string[] | number[]) => void;\n setSelectedItems: React.Dispatch<React.SetStateAction<Iterable<SelectionItemId>>>;\n selectedItems: SelectionItemId[];\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEACuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useListSelection.tsx"],"sourcesContent":["import { SelectionHookParams, useControllableState, useEventCallback, useSelection } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { ListSelectionState } from './types';\n\nexport function useListSelection(options: SelectionHookParams = { selectionMode: 'multiselect' }): ListSelectionState {\n const { selectionMode, defaultSelectedItems, onSelectionChange } = options;\n\n const [selectedItems, setSelectedItems] = useControllableState({\n state: options.selectedItems,\n defaultState: defaultSelectedItems,\n initialState: [],\n });\n\n const [selected, selectionMethods] = useSelection({\n selectionMode,\n defaultSelectedItems,\n selectedItems,\n onSelectionChange: (e, data) => {\n setSelectedItems(data.selectedItems);\n onSelectionChange?.(e, data);\n },\n });\n\n const toggleItem: ListSelectionState['toggleItem'] = useEventCallback((e, itemId) =>\n selectionMethods.toggleItem(e, itemId),\n );\n\n const toggleAllItems: ListSelectionState['toggleAllItems'] = useEventCallback((e, itemIds) => {\n selectionMethods.toggleAllItems(e, itemIds);\n });\n\n const deselectItem: ListSelectionState['deselectItem'] = useEventCallback((e, itemId: string | number) =>\n selectionMethods.deselectItem(e, itemId),\n );\n\n const selectItem: ListSelectionState['selectItem'] = useEventCallback((e, itemId: string | number) =>\n selectionMethods.selectItem(e, itemId),\n );\n\n const clearSelection: ListSelectionState['clearSelection'] = useEventCallback(e => selectionMethods.clearItems(e));\n\n const selectedArray = React.useMemo(() => Array.from(selected), [selected]);\n\n return {\n selectedItems: selectedArray,\n toggleItem,\n toggleAllItems,\n deselectItem,\n selectItem,\n setSelectedItems,\n isSelected: (id: string | number) => selectionMethods.isSelected(id),\n clearSelection,\n };\n}\n"],"names":["useListSelection","options","selectionMode","defaultSelectedItems","onSelectionChange","selectedItems","setSelectedItems","useControllableState","state","defaultState","initialState","selected","selectionMethods","useSelection","e","data","toggleItem","useEventCallback","itemId","toggleAllItems","itemIds","deselectItem","selectItem","clearSelection","clearItems","selectedArray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G;QACAE;QACAC;QACAhB;QACAwB,YAAY,CAACC,KAAwBnB,iBAAiBkB,UAAU,CAACC;QACjER;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/hooks/useListSelection.tsx"],"sourcesContent":["import { SelectionHookParams, useControllableState, useEventCallback, useSelection } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { ListSelectionState } from './types';\n\nexport function useListSelection(options: SelectionHookParams = { selectionMode: 'multiselect' }): ListSelectionState {\n const { selectionMode, defaultSelectedItems, onSelectionChange } = options;\n\n const [selectedItems, setSelectedItems] = useControllableState({\n state: options.selectedItems,\n defaultState: defaultSelectedItems,\n initialState: [],\n });\n\n const [selected, selectionMethods] = useSelection({\n selectionMode,\n defaultSelectedItems,\n selectedItems,\n onSelectionChange: (e, data) => {\n setSelectedItems(data.selectedItems);\n onSelectionChange?.(e, data);\n },\n });\n\n const toggleItem: ListSelectionState['toggleItem'] = useEventCallback((e, itemId) =>\n selectionMethods.toggleItem(e, itemId),\n );\n\n const toggleAllItems: ListSelectionState['toggleAllItems'] = useEventCallback((e, itemIds) => {\n selectionMethods.toggleAllItems(e, itemIds);\n });\n\n const deselectItem: ListSelectionState['deselectItem'] = useEventCallback((e, itemId: string | number) =>\n selectionMethods.deselectItem(e, itemId),\n );\n\n const selectItem: ListSelectionState['selectItem'] = useEventCallback((e, itemId: string | number) =>\n selectionMethods.selectItem(e, itemId),\n );\n\n const clearSelection: ListSelectionState['clearSelection'] = useEventCallback(e => selectionMethods.clearItems(e));\n\n const selectedArray = React.useMemo(() => Array.from(selected), [selected]);\n\n return {\n selectedItems: selectedArray,\n toggleItem,\n toggleAllItems,\n deselectItem,\n selectItem,\n setSelectedItems,\n isSelected: (id: string | number) => selectionMethods.isSelected(id),\n clearSelection,\n };\n}\n"],"names":["useListSelection","options","selectionMode","defaultSelectedItems","onSelectionChange","selectedItems","setSelectedItems","useControllableState","state","defaultState","initialState","selected","selectionMethods","useSelection","e","data","toggleItem","useEventCallback","itemId","toggleAllItems","itemIds","deselectItem","selectItem","clearSelection","clearItems","selectedArray","React","useMemo","Array","from","isSelected","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAIgBA;;;eAAAA;;;;gCAJ0E;iEACnE;AAGhB,SAASA,iBAAiBC,UAA+B;IAAEC,eAAe;AAAc,CAAC;IAC9F,MAAM,EAAEA,aAAa,EAAEC,oBAAoB,EAAEC,iBAAiB,EAAE,GAAGH;IAEnE,MAAM,CAACI,eAAeC,iBAAiB,GAAGC,IAAAA,oCAAAA,EAAqB;QAC7DC,OAAOP,QAAQI,aAAa;QAC5BI,cAAcN;QACdO,cAAc,EAAE;IAClB;IAEA,MAAM,CAACC,UAAUC,iBAAiB,GAAGC,IAAAA,4BAAAA,EAAa;QAChDX;QACAC;QACAE;QACAD,mBAAmB,CAACU,GAAGC;YACrBT,iBAAiBS,KAAKV,aAAa;YACnCD,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAoBU,GAAGC;QACzB;IACF;IAEA,MAAMC,aAA+CC,IAAAA,gCAAAA,EAAiB,CAACH,GAAGI,SACxEN,iBAAiBI,UAAU,CAACF,GAAGI;IAGjC,MAAMC,iBAAuDF,IAAAA,gCAAAA,EAAiB,CAACH,GAAGM;QAChFR,iBAAiBO,cAAc,CAACL,GAAGM;IACrC;IAEA,MAAMC,eAAmDJ,IAAAA,gCAAAA,EAAiB,CAACH,GAAGI,SAC5EN,iBAAiBS,YAAY,CAACP,GAAGI;IAGnC,MAAMI,aAA+CL,IAAAA,gCAAAA,EAAiB,CAACH,GAAGI,SACxEN,iBAAiBU,UAAU,CAACR,GAAGI;IAGjC,MAAMK,iBAAuDN,IAAAA,gCAAAA,EAAiBH,CAAAA,IAAKF,iBAAiBY,UAAU,CAACV;IAE/G,MAAMW,gBAAgBC,OAAMC,OAAO,CAAC,IAAMC,MAAMC,IAAI,CAAClB,WAAW;QAACA;KAAS;IAE1E,OAAO;QACLN,eAAeoB;QACfT;QACAG;QACAE;QACAC;QACAhB;QACAwB,YAAY,CAACC,KAAwBnB,iBAAiBkB,UAAU,CAACC;QACjER;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { List, listClassNames, renderList_unstable, useListStyles_unstable, useList_unstable } from './List';\nexport type { ListProps, ListSlots, ListState } from './List';\n\nexport {\n ListItem,\n listItemClassNames,\n renderListItem_unstable,\n useListItemStyles_unstable,\n useListItem_unstable,\n} from './ListItem';\nexport type { ListItemProps, ListItemSlots, ListItemState } from './ListItem';\n\nexport { useListSelection } from './hooks';\n"],"names":["List","ListItem","listClassNames","listItemClassNames","renderListItem_unstable","renderList_unstable","useListItemStyles_unstable","useListItem_unstable","useListSelection","useListStyles_unstable","useList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAIXC,QAAQ;eAARA,kBAAQ;;IAJKC,cAAc;eAAdA,oBAAc;;IAK3BC,kBAAkB;eAAlBA,4BAAkB;;IAClBC,uBAAuB;eAAvBA,iCAAuB;;IANMC,mBAAmB;eAAnBA,yBAAmB;;IAOhDC,0BAA0B;eAA1BA,oCAA0B;;IAC1BC,oBAAoB;eAApBA,8BAAoB;;IAIbC,gBAAgB;eAAhBA,uBAAgB;;IAZ2BC,sBAAsB;eAAtBA,4BAAsB;;IAAEC,gBAAgB;eAAhBA,sBAAgB;;;sBAAQ;0BAS7F;uBAG0B"}
|
|
1
|
+
{"version":3,"sources":["../src/components/List/index.ts"],"sourcesContent":["export { List, listClassNames, renderList_unstable, useListStyles_unstable, useList_unstable } from './List';\nexport type { ListProps, ListSlots, ListState } from './List';\n\nexport {\n ListItem,\n listItemClassNames,\n renderListItem_unstable,\n useListItemStyles_unstable,\n useListItem_unstable,\n} from './ListItem';\nexport type { ListItemProps, ListItemSlots, ListItemState } from './ListItem';\n\nexport { useListSelection } from './hooks';\n"],"names":["List","ListItem","listClassNames","listItemClassNames","renderListItem_unstable","renderList_unstable","useListItemStyles_unstable","useListItem_unstable","useListSelection","useListStyles_unstable","useList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,IAAI;eAAJA,UAAI;;IAIXC,QAAQ;eAARA,kBAAQ;;IAJKC,cAAc;eAAdA,oBAAc;;IAK3BC,kBAAkB;eAAlBA,4BAAkB;;IAClBC,uBAAuB;eAAvBA,iCAAuB;;IANMC,mBAAmB;eAAnBA,yBAAmB;;IAOhDC,0BAA0B;eAA1BA,oCAA0B;;IAC1BC,oBAAoB;eAApBA,8BAAoB;;IAIbC,gBAAgB;eAAhBA,uBAAgB;;IAZ2BC,sBAAsB;eAAtBA,4BAAsB;;IAAEC,gBAAgB;eAAhBA,sBAAgB;;;sBAAQ;0BAS7F;uBAG0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Primitive.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeClasses } from '@fluentui/react-components';\n\n// Simplified version from https://github.com/reach/reach-ui/blob/55d28eda39afc4c667e97f5f62a48d1de034b93f/packages/utils/src/polymorphic.ts\ninterface PrimitiveComponent {\n /**\n * Infers props from JSX.IntrinsicElements based on \"as\" value. Explicitly avoids `React.ElementType` and manually\n * narrow the prop types so that events are typed when using JSX.IntrinsicElements.\n */\n <As extends keyof JSX.IntrinsicElements>(props: { as?: As } & JSX.IntrinsicElements[As]): React.ReactElement | null;\n\n displayName: string;\n}\n\nexport const primitiveClassName = 'fui-Primitive';\n\nexport const Primitive = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement> & { as: 'div' }>(\n (props, ref) => {\n const { as: Component = 'div', ...rest } = props;\n\n const dir = typeof props.children === 'string' ? 'auto' : undefined;\n\n const className = mergeClasses(primitiveClassName, props.className);\n\n return <Component dir={dir} {...rest} className={className} ref={ref} />;\n },\n) as PrimitiveComponent;\n\nPrimitive.displayName = 'Primitive';\n"],"names":["Primitive","primitiveClassName","React","forwardRef","props","ref","as","Component","rest","dir","children","undefined","className","mergeClasses","createElement","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAgBaA,SAAAA;eAAAA;;IAFAC,kBAAAA;eAAAA;;;;iEAdU;iCACM;AAatB,MAAMA,qBAAqB;AAE3B,MAAMD,YAAAA,WAAAA,GAAYE,OAAMC,UAAU,CACvC,CAACC,OAAOC;IACN,MAAM,EAAEC,IAAIC,YAAY,KAAK,EAAE,GAAGC,MAAM,GAAGJ;IAE3C,MAAMK,MAAM,OAAOL,MAAMM,QAAQ,KAAK,WAAW,SAASC;IAE1D,MAAMC,YAAYC,IAAAA,6BAAAA,EAAaZ,oBAAoBG,MAAMQ,SAAS;IAElE,OAAA,WAAA,GAAOV,OAAAY,aAAA,CAACP,WAAAA;QAAUE,KAAKA;QAAM,GAAGD,IAAI;QAAEI,WAAWA;QAAWP,KAAKA;;AACnE;AAGFL,UAAUe,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Primitive/Primitive.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeClasses } from '@fluentui/react-components';\n\n// Simplified version from https://github.com/reach/reach-ui/blob/55d28eda39afc4c667e97f5f62a48d1de034b93f/packages/utils/src/polymorphic.ts\ninterface PrimitiveComponent {\n /**\n * Infers props from JSX.IntrinsicElements based on \"as\" value. Explicitly avoids `React.ElementType` and manually\n * narrow the prop types so that events are typed when using JSX.IntrinsicElements.\n */\n <As extends keyof JSX.IntrinsicElements>(props: { as?: As } & JSX.IntrinsicElements[As]): React.ReactElement | null;\n\n displayName: string;\n}\n\nexport const primitiveClassName = 'fui-Primitive';\n\nexport const Primitive = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement> & { as: 'div' }>(\n (props, ref) => {\n const { as: Component = 'div', ...rest } = props;\n\n const dir = typeof props.children === 'string' ? 'auto' : undefined;\n\n const className = mergeClasses(primitiveClassName, props.className);\n\n return <Component dir={dir} {...rest} className={className} ref={ref} />;\n },\n) as PrimitiveComponent;\n\nPrimitive.displayName = 'Primitive';\n"],"names":["Primitive","primitiveClassName","React","forwardRef","props","ref","as","Component","rest","dir","children","undefined","className","mergeClasses","createElement","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAgBaA,SAAAA;eAAAA;;IAFAC,kBAAAA;eAAAA;;;;iEAdU;iCACM;AAatB,MAAMA,qBAAqB;AAE3B,MAAMD,YAAAA,WAAAA,GAAYE,OAAMC,UAAU,CACvC,CAACC,OAAOC;IACN,MAAM,EAAEC,IAAIC,YAAY,KAAK,EAAE,GAAGC,MAAM,GAAGJ;IAE3C,MAAMK,MAAM,OAAOL,MAAMM,QAAQ,KAAK,WAAW,SAASC;IAE1D,MAAMC,YAAYC,IAAAA,6BAAAA,EAAaZ,oBAAoBG,MAAMQ,SAAS;IAElE,OAAA,WAAA,GAAOV,OAAAY,aAAA,CAACP,WAAAA;QAAUE,KAAKA;QAAM,GAAGD,IAAI;QAAEI,WAAWA;QAAWP,KAAKA;;AACnE;AAGFL,UAAUe,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"sourcesContent":["export * from './Primitive';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Primitive/index.tsx"],"sourcesContent":["export * from './Primitive';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Segment.tsx"],"sourcesContent":["import { mergeClasses } from '@fluentui/react-components';\nimport * as React from 'react';\n\nimport { useSegmentStyles } from './Segment.styles';\n\nexport const segmentClassName = 'fui-Segment';\n\nexport const Segment = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement>>((props, ref) => {\n const { children, className, ...rest } = props;\n const classes = useSegmentStyles();\n\n const segmentClasses = mergeClasses(segmentClassName, classes.segment, className);\n\n return (\n <div ref={ref} className={segmentClasses} {...rest}>\n {children}\n </div>\n );\n});\n\nSegment.displayName = 'Segment';\n"],"names":["Segment","segmentClassName","React","forwardRef","props","ref","children","className","rest","classes","useSegmentStyles","segmentClasses","mergeClasses","segment","createElement","div","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,OAAAA;eAAAA;;IAFAC,gBAAAA;eAAAA;;;;iCALgB;iEACN;+BAEU;AAE1B,MAAMA,mBAAmB;AAEzB,MAAMD,UAAAA,WAAAA,GAAUE,OAAMC,UAAU,CAAoD,CAACC,OAAOC;IACjG,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGJ;IACzC,MAAMK,UAAUC,IAAAA,+BAAAA;IAEhB,MAAMC,iBAAiBC,IAAAA,6BAAAA,EAAaX,kBAAkBQ,QAAQI,OAAO,EAAEN;IAEvE,OAAA,WAAA,GACEL,OAAAY,aAAA,CAACC,OAAAA;QAAIV,KAAKA;QAAKE,WAAWI;QAAiB,GAAGH,IAAI;OAC/CF;AAGP;AAEAN,QAAQgB,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Segment/Segment.tsx"],"sourcesContent":["import { mergeClasses } from '@fluentui/react-components';\nimport * as React from 'react';\n\nimport { useSegmentStyles } from './Segment.styles';\n\nexport const segmentClassName = 'fui-Segment';\n\nexport const Segment = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement>>((props, ref) => {\n const { children, className, ...rest } = props;\n const classes = useSegmentStyles();\n\n const segmentClasses = mergeClasses(segmentClassName, classes.segment, className);\n\n return (\n <div ref={ref} className={segmentClasses} {...rest}>\n {children}\n </div>\n );\n});\n\nSegment.displayName = 'Segment';\n"],"names":["Segment","segmentClassName","React","forwardRef","props","ref","children","className","rest","classes","useSegmentStyles","segmentClasses","mergeClasses","segment","createElement","div","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,OAAAA;eAAAA;;IAFAC,gBAAAA;eAAAA;;;;iCALgB;iEACN;+BAEU;AAE1B,MAAMA,mBAAmB;AAEzB,MAAMD,UAAAA,WAAAA,GAAUE,OAAMC,UAAU,CAAoD,CAACC,OAAOC;IACjG,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGJ;IACzC,MAAMK,UAAUC,IAAAA,+BAAAA;IAEhB,MAAMC,iBAAiBC,IAAAA,6BAAAA,EAAaX,kBAAkBQ,QAAQI,OAAO,EAAEN;IAEvE,OAAA,WAAA,GACEL,OAAAY,aAAA,CAACC,OAAAA;QAAIV,KAAKA;QAAKE,WAAWI;QAAiB,GAAGH,IAAI;OAC/CF;AAGP;AAEAN,QAAQgB,WAAW,GAAG"}
|
|
@@ -72,4 +72,4 @@ const useSegmentStyles = /*#__PURE__*/ (0, _reactcomponents.__styles)({
|
|
|
72
72
|
".fxugw4r{background-color:var(--colorNeutralBackground1);}",
|
|
73
73
|
".f16uyjdj{box-shadow:0 1px 1px 1px var(--colorNeutralShadowKey);}"
|
|
74
74
|
]
|
|
75
|
-
});
|
|
75
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Segment';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Segment/index.ts"],"sourcesContent":["export * from './Segment';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Slider.mixins.ts"],"sourcesContent":["import { GriffelStyle } from '@fluentui/react-components';\n\nconst fluid = (): GriffelStyle => ({ width: '100%' });\n\nexport const slider = {\n fluid,\n};\n"],"names":["slider","fluid","width"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BAIaA;;;eAAAA;;;AAFb,MAAMC,QAAQ,IAAqB,CAAA;QAAEC,OAAO;IAAO,CAAA;AAE5C,MAAMF,SAAS;IACpBC;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Slider/Slider.mixins.ts"],"sourcesContent":["import { GriffelStyle } from '@fluentui/react-components';\n\nconst fluid = (): GriffelStyle => ({ width: '100%' });\n\nexport const slider = {\n fluid,\n};\n"],"names":["slider","fluid","width"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BAIaA;;;eAAAA;;;AAFb,MAAMC,QAAQ,IAAqB,CAAA;QAAEC,OAAO;IAAO,CAAA;AAE5C,MAAMF,SAAS;IACpBC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { slider } from './Slider.mixins';\n"],"names":["slider"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,oBAAM;;;8BAAQ"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Slider/index.ts"],"sourcesContent":["export { slider } from './Slider.mixins';\n"],"names":["slider"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,oBAAM;;;8BAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SpinnerMigration.mixins.ts"],"sourcesContent":["import { GriffelStyle, tokens, labelClassNames } from '@fluentui/react-components';\n\nconst v0Inline = (): GriffelStyle => ({ display: 'inline-flex' });\n\nconst v0SpinnerLabelStyle = (): GriffelStyle => ({\n [`& .${labelClassNames.root}`]: {\n fontSize: '14px',\n fontWeight: tokens.fontWeightMedium,\n },\n});\n\nexport const spinner = {\n v0Inline,\n v0SpinnerLabelStyle,\n};\n"],"names":["spinner","v0Inline","display","v0SpinnerLabelStyle","labelClassNames","root","fontSize","fontWeight","tokens","fontWeightMedium"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;iCAXyC;AAEtD,MAAMC,WAAW,IAAqB,CAAA;QAAEC,SAAS;IAAc,CAAA;AAE/D,MAAMC,sBAAsB,IAAqB,CAAA;QAC/C,CAAC,CAAC,GAAG,EAAEC,gCAAAA,CAAgBC,IAAI,CAAC,CAAC,CAAC,EAAE;YAC9BC,UAAU;YACVC,YAAYC,uBAAAA,CAAOC,gBAAgB;QACrC;IACF,CAAA;AAEO,MAAMT,UAAU;IACrBC;IACAE;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/SpinnerMigration.mixins.ts"],"sourcesContent":["import { GriffelStyle, tokens, labelClassNames } from '@fluentui/react-components';\n\nconst v0Inline = (): GriffelStyle => ({ display: 'inline-flex' });\n\nconst v0SpinnerLabelStyle = (): GriffelStyle => ({\n [`& .${labelClassNames.root}`]: {\n fontSize: '14px',\n fontWeight: tokens.fontWeightMedium,\n },\n});\n\nexport const spinner = {\n v0Inline,\n v0SpinnerLabelStyle,\n};\n"],"names":["spinner","v0Inline","display","v0SpinnerLabelStyle","labelClassNames","root","fontSize","fontWeight","tokens","fontWeightMedium"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;iCAXyC;AAEtD,MAAMC,WAAW,IAAqB,CAAA;QAAEC,SAAS;IAAc,CAAA;AAE/D,MAAMC,sBAAsB,IAAqB,CAAA;QAC/C,CAAC,CAAC,GAAG,EAAEC,gCAAAA,CAAgBC,IAAI,CAAC,CAAC,CAAC,EAAE;YAC9BC,UAAU;YACVC,YAAYC,uBAAAA,CAAOC,gBAAgB;QACrC;IACF,CAAA;AAEO,MAAMT,UAAU;IACrBC;IACAE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"sourcesContent":["export { spinner } from './SpinnerMigration.mixins';\n"],"names":["spinner"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,+BAAO;;;wCAAQ"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Spinner/index.tsx"],"sourcesContent":["export { spinner } from './SpinnerMigration.mixins';\n"],"names":["spinner"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,+BAAO;;;wCAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StyledText.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, mergeClasses, Slot, ComponentProps, slot } from '@fluentui/react-components';\nimport { useSizeStyles, useStyles, useWeightStyles } from './StyledText.styles';\n\nexport type StyledTextSlots = {\n root: Slot<'span', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'pre' | 'time'>;\n};\n\nexport type StyledTextProps = ComponentProps<StyledTextSlots> & {\n /**\n * Aligns text based on the parent container.\n */\n align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * At mentions can be formatted to draw users' attention.\n * Mentions for \"me\" can be formatted to appear differently.\n */\n atMention?: 'me' | boolean;\n\n /**\n * Set as disabled StyledText component\n */\n disabled?: boolean;\n\n /**\n * Set as error StyledText component\n */\n error?: boolean;\n\n /**\n * The StyledText can appear more important and draw user's attention\n */\n important?: boolean;\n\n /**\n * Applies font size and line height based on the theme tokens.\n */\n size?:\n | 'smaller'\n | 'small'\n | 'medium'\n | 'large'\n | 'large500'\n | 'larger'\n | 'largest'\n | 100\n | 200\n | 300\n | 400\n | 500\n | 600\n | 700;\n\n /**\n * Set as success StyledText component\n */\n success?: boolean;\n\n /**\n * The text can signify a temporary state\n */\n temporary?: boolean;\n\n /**\n * Set as timestamp StyledText component\n */\n timestamp?: boolean;\n\n /**\n * Truncate overflowing text for block displays.\n */\n truncate?: boolean;\n\n /**\n * Applies font weight to the content.\n */\n weight?: 'light' | 'semilight' | 'regular' | 'medium' | 'semibold' | 'bold';\n\n /**\n * Wraps the text content on white spaces.\n *\n * @default true\n */\n wrap?: boolean;\n};\n\nexport const styledTextClassName = 'fui-StyledText';\n\nconst sizeMap: Record<string, 'base100' | 'base200' | 'base300' | 'base400' | 'base500' | 'base600' | 'hero700'> = {\n '100': 'base100',\n '200': 'base200',\n '300': 'base300',\n '400': 'base400',\n '500': 'base500',\n '600': 'base600',\n '700': 'hero700',\n smaller: 'base100',\n small: 'base200',\n medium: 'base300',\n large: 'base400',\n large500: 'base500',\n larger: 'base600',\n largest: 'hero700',\n};\n\nexport const StyledText = React.forwardRef<HTMLSpanElement, StyledTextProps>((props, ref) => {\n const {\n align,\n atMention,\n disabled,\n error,\n important,\n success,\n temporary,\n timestamp,\n truncate,\n weight,\n wrap = true,\n } = props;\n\n const dir = typeof props.children === 'string' ? 'auto' : undefined;\n\n const sizeStyles = useSizeStyles();\n const weightStyles = useWeightStyles();\n const styles = useStyles();\n\n const size = props.size ? sizeMap[props.size] : props.size;\n\n const RootSlot = slot.always(\n getIntrinsicElementProps('span', {\n ref,\n ...props,\n dir,\n className: mergeClasses(\n styledTextClassName,\n size && sizeStyles[size],\n weight && weightStyles[weight],\n wrap === false && styles.nowrap,\n truncate && styles.truncate,\n align === 'center' && styles.alignCenter,\n align === 'end' && styles.alignEnd,\n align === 'justify' && styles.alignJustify,\n\n atMention && styles.mention,\n atMention === 'me' && styles.mentionMe,\n disabled && styles.disabled,\n error && styles.error,\n important && styles.important,\n success && styles.success,\n temporary && styles.temporary,\n timestamp && styles.timestamp,\n props.className,\n ),\n }),\n { elementType: 'span' },\n );\n\n return <RootSlot />;\n});\n\nStyledText.displayName = 'StyledText';\n"],"names":["StyledText","styledTextClassName","sizeMap","smaller","small","medium","large","large500","larger","largest","React","forwardRef","props","ref","align","atMention","disabled","error","important","success","temporary","timestamp","truncate","weight","wrap","dir","children","undefined","sizeStyles","useSizeStyles","weightStyles","useWeightStyles","styles","useStyles","size","RootSlot","slot","always","getIntrinsicElementProps","className","mergeClasses","nowrap","alignCenter","alignEnd","alignJustify","mention","mentionMe","elementType","_jsx","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA6GaA,UAAAA;eAAAA;;IAnBAC,mBAAAA;eAAAA;;;;4BAzFb;iEAEuB;iCAC4D;kCACzB;AAqFnD,MAAMA,sBAAsB;AAEnC,MAAMC,UAA6G;IACjH,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACPC,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,UAAU;IACVC,QAAQ;IACRC,SAAS;AACX;AAEO,MAAMT,aAAAA,WAAAA,GAAaU,OAAMC,UAAU,CAAmC,CAACC,OAAOC;IACnF,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,IAAI,EACZ,GAAGZ;IAEJ,MAAMa,MAAM,OAAOb,MAAMc,QAAQ,KAAK,WAAW,SAASC;IAE1D,MAAMC,aAAaC,IAAAA,+BAAAA;IACnB,MAAMC,eAAeC,IAAAA,iCAAAA;IACrB,MAAMC,SAASC,IAAAA,2BAAAA;IAEf,MAAMC,OAAOtB,MAAMsB,IAAI,GAAGhC,OAAO,CAACU,MAAMsB,IAAI,CAAC,GAAGtB,MAAMsB,IAAI;IAE1D,MAAMC,WAAWC,qBAAAA,CAAKC,MAAM,CAC1BC,IAAAA,yCAAAA,EAAyB,QAAQ;QAC/BzB;QACA,GAAGD,KAAK;QACRa;QACAc,WAAWC,IAAAA,6BAAAA,EACTvC,qBACAiC,QAAQN,UAAU,CAACM,KAAK,EACxBX,UAAUO,YAAY,CAACP,OAAO,EAC9BC,SAAS,SAASQ,OAAOS,MAAM,EAC/BnB,YAAYU,OAAOV,QAAQ,EAC3BR,UAAU,YAAYkB,OAAOU,WAAW,EACxC5B,UAAU,SAASkB,OAAOW,QAAQ,EAClC7B,UAAU,aAAakB,OAAOY,YAAY,EAE1C7B,aAAaiB,OAAOa,OAAO,EAC3B9B,cAAc,QAAQiB,OAAOc,SAAS,EACtC9B,YAAYgB,OAAOhB,QAAQ,EAC3BC,SAASe,OAAOf,KAAK,EACrBC,aAAac,OAAOd,SAAS,EAC7BC,WAAWa,OAAOb,OAAO,EACzBC,aAAaY,OAAOZ,SAAS,EAC7BC,aAAaW,OAAOX,SAAS,EAC7BT,MAAM2B,SAAS;IAEnB,IACA;QAAEQ,aAAa;IAAO;IAGxB,OAAA,WAAA,GAAOC,IAAAA,eAAA,EAACb,UAAAA,CAAAA;AACV;AAEAnC,WAAWiD,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/StyledText/StyledText.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, mergeClasses, Slot, ComponentProps, slot } from '@fluentui/react-components';\nimport { useSizeStyles, useStyles, useWeightStyles } from './StyledText.styles';\n\nexport type StyledTextSlots = {\n root: Slot<'span', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'pre' | 'time'>;\n};\n\nexport type StyledTextProps = ComponentProps<StyledTextSlots> & {\n /**\n * Aligns text based on the parent container.\n */\n align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * At mentions can be formatted to draw users' attention.\n * Mentions for \"me\" can be formatted to appear differently.\n */\n atMention?: 'me' | boolean;\n\n /**\n * Set as disabled StyledText component\n */\n disabled?: boolean;\n\n /**\n * Set as error StyledText component\n */\n error?: boolean;\n\n /**\n * The StyledText can appear more important and draw user's attention\n */\n important?: boolean;\n\n /**\n * Applies font size and line height based on the theme tokens.\n */\n size?:\n | 'smaller'\n | 'small'\n | 'medium'\n | 'large'\n | 'large500'\n | 'larger'\n | 'largest'\n | 100\n | 200\n | 300\n | 400\n | 500\n | 600\n | 700;\n\n /**\n * Set as success StyledText component\n */\n success?: boolean;\n\n /**\n * The text can signify a temporary state\n */\n temporary?: boolean;\n\n /**\n * Set as timestamp StyledText component\n */\n timestamp?: boolean;\n\n /**\n * Truncate overflowing text for block displays.\n */\n truncate?: boolean;\n\n /**\n * Applies font weight to the content.\n */\n weight?: 'light' | 'semilight' | 'regular' | 'medium' | 'semibold' | 'bold';\n\n /**\n * Wraps the text content on white spaces.\n *\n * @default true\n */\n wrap?: boolean;\n};\n\nexport const styledTextClassName = 'fui-StyledText';\n\nconst sizeMap: Record<string, 'base100' | 'base200' | 'base300' | 'base400' | 'base500' | 'base600' | 'hero700'> = {\n '100': 'base100',\n '200': 'base200',\n '300': 'base300',\n '400': 'base400',\n '500': 'base500',\n '600': 'base600',\n '700': 'hero700',\n smaller: 'base100',\n small: 'base200',\n medium: 'base300',\n large: 'base400',\n large500: 'base500',\n larger: 'base600',\n largest: 'hero700',\n};\n\nexport const StyledText = React.forwardRef<HTMLSpanElement, StyledTextProps>((props, ref) => {\n const {\n align,\n atMention,\n disabled,\n error,\n important,\n success,\n temporary,\n timestamp,\n truncate,\n weight,\n wrap = true,\n } = props;\n\n const dir = typeof props.children === 'string' ? 'auto' : undefined;\n\n const sizeStyles = useSizeStyles();\n const weightStyles = useWeightStyles();\n const styles = useStyles();\n\n const size = props.size ? sizeMap[props.size] : props.size;\n\n const RootSlot = slot.always(\n getIntrinsicElementProps('span', {\n ref,\n ...props,\n dir,\n className: mergeClasses(\n styledTextClassName,\n size && sizeStyles[size],\n weight && weightStyles[weight],\n wrap === false && styles.nowrap,\n truncate && styles.truncate,\n align === 'center' && styles.alignCenter,\n align === 'end' && styles.alignEnd,\n align === 'justify' && styles.alignJustify,\n\n atMention && styles.mention,\n atMention === 'me' && styles.mentionMe,\n disabled && styles.disabled,\n error && styles.error,\n important && styles.important,\n success && styles.success,\n temporary && styles.temporary,\n timestamp && styles.timestamp,\n props.className,\n ),\n }),\n { elementType: 'span' },\n );\n\n return <RootSlot />;\n});\n\nStyledText.displayName = 'StyledText';\n"],"names":["StyledText","styledTextClassName","sizeMap","smaller","small","medium","large","large500","larger","largest","React","forwardRef","props","ref","align","atMention","disabled","error","important","success","temporary","timestamp","truncate","weight","wrap","dir","children","undefined","sizeStyles","useSizeStyles","weightStyles","useWeightStyles","styles","useStyles","size","RootSlot","slot","always","getIntrinsicElementProps","className","mergeClasses","nowrap","alignCenter","alignEnd","alignJustify","mention","mentionMe","elementType","_jsx","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA6GaA,UAAAA;eAAAA;;IAnBAC,mBAAAA;eAAAA;;;;4BAzFb;iEAEuB;iCAC4D;kCACzB;AAqFnD,MAAMA,sBAAsB;AAEnC,MAAMC,UAA6G;IACjH,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACPC,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,UAAU;IACVC,QAAQ;IACRC,SAAS;AACX;AAEO,MAAMT,aAAAA,WAAAA,GAAaU,OAAMC,UAAU,CAAmC,CAACC,OAAOC;IACnF,MAAM,EACJC,KAAK,EACLC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,IAAI,EACZ,GAAGZ;IAEJ,MAAMa,MAAM,OAAOb,MAAMc,QAAQ,KAAK,WAAW,SAASC;IAE1D,MAAMC,aAAaC,IAAAA,+BAAAA;IACnB,MAAMC,eAAeC,IAAAA,iCAAAA;IACrB,MAAMC,SAASC,IAAAA,2BAAAA;IAEf,MAAMC,OAAOtB,MAAMsB,IAAI,GAAGhC,OAAO,CAACU,MAAMsB,IAAI,CAAC,GAAGtB,MAAMsB,IAAI;IAE1D,MAAMC,WAAWC,qBAAAA,CAAKC,MAAM,CAC1BC,IAAAA,yCAAAA,EAAyB,QAAQ;QAC/BzB;QACA,GAAGD,KAAK;QACRa;QACAc,WAAWC,IAAAA,6BAAAA,EACTvC,qBACAiC,QAAQN,UAAU,CAACM,KAAK,EACxBX,UAAUO,YAAY,CAACP,OAAO,EAC9BC,SAAS,SAASQ,OAAOS,MAAM,EAC/BnB,YAAYU,OAAOV,QAAQ,EAC3BR,UAAU,YAAYkB,OAAOU,WAAW,EACxC5B,UAAU,SAASkB,OAAOW,QAAQ,EAClC7B,UAAU,aAAakB,OAAOY,YAAY,EAE1C7B,aAAaiB,OAAOa,OAAO,EAC3B9B,cAAc,QAAQiB,OAAOc,SAAS,EACtC9B,YAAYgB,OAAOhB,QAAQ,EAC3BC,SAASe,OAAOf,KAAK,EACrBC,aAAac,OAAOd,SAAS,EAC7BC,WAAWa,OAAOb,OAAO,EACzBC,aAAaY,OAAOZ,SAAS,EAC7BC,aAAaW,OAAOX,SAAS,EAC7BT,MAAM2B,SAAS;IAEnB,IACA;QAAEQ,aAAa;IAAO;IAGxB,OAAA,WAAA,GAAOC,IAAAA,eAAA,EAACb,UAAAA,CAAAA;AACV;AAEAnC,WAAWiD,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"sourcesContent":["export * from './StyledText';\nexport * from './StyledText.styles';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
|
|
1
|
+
{"version":3,"sources":["../src/components/StyledText/index.tsx"],"sourcesContent":["export * from './StyledText';\nexport * from './StyledText.styles';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Video.tsx"],"sourcesContent":["import { mergeClasses, useMergedRefs } from '@fluentui/react-components';\nimport * as React from 'react';\nimport { useVideoStyles } from './Video.styles';\n\nexport const videoClassName = 'fui-Video';\n\n/**\n * Video component props\n */\nexport interface VideoProps extends React.VideoHTMLAttributes<HTMLVideoElement> {\n /**\n * The source URL of the video\n */\n src: string;\n\n /**\n * Whether the video should start playing automatically\n * @default false\n */\n autoPlay?: boolean;\n\n /**\n * Whether the video should display controls\n * @default true\n */\n controls?: boolean;\n\n /**\n * Whether the video should loop\n */\n loop?: boolean;\n\n /**\n * Whether the video should be muted\n */\n muted?: boolean;\n\n /**\n * The URL of an image to display while the video is loading\n */\n poster?: string;\n}\n\nexport const Video = React.forwardRef<HTMLVideoElement, VideoProps>((props, ref) => {\n 'use no memo';\n\n const { className, muted, ...rest } = props;\n\n const videoRef = React.useRef<HTMLVideoElement>();\n\n const classes = useVideoStyles();\n React.useEffect(() => {\n // this is a workaround for a potential memory leak in Chromium which retains a Detached HTMLVideoElement when <video autoplay> is unmounted\n // https://bugs.chromium.org/p/chromium/issues/detail?id=969049\n return () => {\n if (videoRef?.current) {\n // we want to perform the cleanup on the latest element rendered\n // eslint-disable-next-line react-hooks/exhaustive-deps\n videoRef.current.src = '';\n }\n };\n }, [videoRef]);\n\n React.useEffect(() => {\n // React doesn't guarantee that props will be set:\n // https://github.com/facebook/react/issues/10389\n if (videoRef.current) {\n videoRef.current.muted = !!muted;\n }\n }, [muted]);\n\n return (\n <video\n ref={useMergedRefs(ref, videoRef) as React.Ref<HTMLVideoElement>}\n role=\"application\"\n className={mergeClasses(videoClassName, classes.root, className)}\n controls={true}\n autoPlay={false}\n muted={muted}\n {...rest}\n />\n );\n});\n\nVideo.displayName = 'Video';\n"],"names":["Video","videoClassName","React","forwardRef","props","ref","className","muted","rest","videoRef","useRef","classes","useVideoStyles","useEffect","current","src","createElement","video","useMergedRefs","role","mergeClasses","root","controls","autoPlay","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA2CaA,KAAAA;eAAAA;;IAvCAC,cAAAA;eAAAA;;;;iCAJ+B;iEACrB;6BACQ;AAExB,MAAMA,iBAAiB;AAuCvB,MAAMD,QAAAA,WAAAA,GAAQE,OAAMC,UAAU,CAA+B,CAACC,OAAOC;IAC1E;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGJ;IAEtC,MAAMK,WAAWP,OAAMQ,MAAM;IAE7B,MAAMC,UAAUC,IAAAA,2BAAAA;IAChBV,OAAMW,SAAS,CAAC;QACd,4IAA4I;QAC5I,+DAA+D;QAC/D,OAAO;YACL,IAAIJ,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAUK,OAAO,EAAE;gBACrB,gEAAgE;gBAChE,uDAAuD;gBACvDL,SAASK,OAAO,CAACC,GAAG,GAAG;YACzB;QACF;IACF,GAAG;QAACN;KAAS;IAEbP,OAAMW,SAAS,CAAC;QACd,kDAAkD;QAClD,iDAAiD;QACjD,IAAIJ,SAASK,OAAO,EAAE;YACpBL,SAASK,OAAO,CAACP,KAAK,GAAG,CAAC,CAACA;QAC7B;IACF,GAAG;QAACA;KAAM;IAEV,OAAA,WAAA,GACEL,OAAAc,aAAA,CAACC,SAAAA;QACCZ,KAAKa,IAAAA,8BAAAA,EAAcb,KAAKI;QACxBU,MAAK;QACLb,WAAWc,IAAAA,6BAAAA,EAAanB,gBAAgBU,QAAQU,IAAI,EAAEf;QACtDgB,UAAU;QACVC,UAAU;QACVhB,OAAOA;QACN,GAAGC,IAAI;;AAGd;AAEAR,MAAMwB,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Video/Video.tsx"],"sourcesContent":["import { mergeClasses, useMergedRefs } from '@fluentui/react-components';\nimport * as React from 'react';\nimport { useVideoStyles } from './Video.styles';\n\nexport const videoClassName = 'fui-Video';\n\n/**\n * Video component props\n */\nexport interface VideoProps extends React.VideoHTMLAttributes<HTMLVideoElement> {\n /**\n * The source URL of the video\n */\n src: string;\n\n /**\n * Whether the video should start playing automatically\n * @default false\n */\n autoPlay?: boolean;\n\n /**\n * Whether the video should display controls\n * @default true\n */\n controls?: boolean;\n\n /**\n * Whether the video should loop\n */\n loop?: boolean;\n\n /**\n * Whether the video should be muted\n */\n muted?: boolean;\n\n /**\n * The URL of an image to display while the video is loading\n */\n poster?: string;\n}\n\nexport const Video = React.forwardRef<HTMLVideoElement, VideoProps>((props, ref) => {\n 'use no memo';\n\n const { className, muted, ...rest } = props;\n\n const videoRef = React.useRef<HTMLVideoElement>();\n\n const classes = useVideoStyles();\n React.useEffect(() => {\n // this is a workaround for a potential memory leak in Chromium which retains a Detached HTMLVideoElement when <video autoplay> is unmounted\n // https://bugs.chromium.org/p/chromium/issues/detail?id=969049\n return () => {\n if (videoRef?.current) {\n // we want to perform the cleanup on the latest element rendered\n // eslint-disable-next-line react-hooks/exhaustive-deps\n videoRef.current.src = '';\n }\n };\n }, [videoRef]);\n\n React.useEffect(() => {\n // React doesn't guarantee that props will be set:\n // https://github.com/facebook/react/issues/10389\n if (videoRef.current) {\n videoRef.current.muted = !!muted;\n }\n }, [muted]);\n\n return (\n <video\n ref={useMergedRefs(ref, videoRef) as React.Ref<HTMLVideoElement>}\n role=\"application\"\n className={mergeClasses(videoClassName, classes.root, className)}\n controls={true}\n autoPlay={false}\n muted={muted}\n {...rest}\n />\n );\n});\n\nVideo.displayName = 'Video';\n"],"names":["Video","videoClassName","React","forwardRef","props","ref","className","muted","rest","videoRef","useRef","classes","useVideoStyles","useEffect","current","src","createElement","video","useMergedRefs","role","mergeClasses","root","controls","autoPlay","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA2CaA,KAAAA;eAAAA;;IAvCAC,cAAAA;eAAAA;;;;iCAJ+B;iEACrB;6BACQ;AAExB,MAAMA,iBAAiB;AAuCvB,MAAMD,QAAAA,WAAAA,GAAQE,OAAMC,UAAU,CAA+B,CAACC,OAAOC;IAC1E;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGJ;IAEtC,MAAMK,WAAWP,OAAMQ,MAAM;IAE7B,MAAMC,UAAUC,IAAAA,2BAAAA;IAChBV,OAAMW,SAAS,CAAC;QACd,4IAA4I;QAC5I,+DAA+D;QAC/D,OAAO;YACL,IAAIJ,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAUK,OAAO,EAAE;gBACrB,gEAAgE;gBAChE,uDAAuD;gBACvDL,SAASK,OAAO,CAACC,GAAG,GAAG;YACzB;QACF;IACF,GAAG;QAACN;KAAS;IAEbP,OAAMW,SAAS,CAAC;QACd,kDAAkD;QAClD,iDAAiD;QACjD,IAAIJ,SAASK,OAAO,EAAE;YACpBL,SAASK,OAAO,CAACP,KAAK,GAAG,CAAC,CAACA;QAC7B;IACF,GAAG;QAACA;KAAM;IAEV,OAAA,WAAA,GACEL,OAAAc,aAAA,CAACC,SAAAA;QACCZ,KAAKa,IAAAA,8BAAAA,EAAcb,KAAKI;QACxBU,MAAK;QACLb,WAAWc,IAAAA,6BAAAA,EAAanB,gBAAgBU,QAAQU,IAAI,EAAEf;QACtDgB,UAAU;QACVC,UAAU;QACVhB,OAAOA;QACN,GAAGC,IAAI;;AAGd;AAEAR,MAAMwB,WAAW,GAAG"}
|