@elliemae/ds-form-radio 3.70.0-next.9 → 3.70.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ControlledRadio.js +27 -2
- package/dist/cjs/ControlledRadio.js.map +2 -2
- package/dist/cjs/TruncatedTooltipText.js +45 -7
- package/dist/cjs/TruncatedTooltipText.js.map +2 -2
- package/dist/cjs/exported-related/data-test-ids.js +5 -0
- package/dist/cjs/exported-related/data-test-ids.js.map +2 -2
- package/dist/cjs/exported-related/theming.js +6 -1
- package/dist/cjs/exported-related/theming.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styles.js +12 -30
- package/dist/cjs/styles.js.map +2 -2
- package/dist/esm/ControlledRadio.js +37 -4
- package/dist/esm/ControlledRadio.js.map +2 -2
- package/dist/esm/TruncatedTooltipText.js +45 -7
- package/dist/esm/TruncatedTooltipText.js.map +2 -2
- package/dist/esm/exported-related/data-test-ids.js +5 -0
- package/dist/esm/exported-related/data-test-ids.js.map +2 -2
- package/dist/esm/exported-related/theming.js +6 -1
- package/dist/esm/exported-related/theming.js.map +2 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styles.js +13 -31
- package/dist/esm/styles.js.map +2 -2
- package/dist/types/TruncatedTooltipText.d.ts +4 -1
- package/dist/types/exported-related/data-test-ids.d.ts +9 -3
- package/dist/types/exported-related/theming.d.ts +8 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/styles.d.ts +1 -1
- package/package.json +11 -10
- package/dist/types/tests/DSControlledRadio.HTMLStandards.tests.d.ts +0 -1
- package/dist/types/tests/DSControlledRadio.a11y.test.d.ts +0 -1
- package/dist/types/tests/DSControlledRadio.keyboard.test.d.ts +0 -1
- package/dist/types/tests/DSControlledRadio.test.d.ts +0 -1
- package/dist/types/tests/DSControllledRadio.events.test.d.ts +0 -1
- package/dist/types/tests/axe.test.d.ts +0 -1
|
@@ -73,6 +73,7 @@ const DSControlledRadio = (props) => {
|
|
|
73
73
|
);
|
|
74
74
|
const instanceUid = (0, import_react.useMemo)(() => id || `ds-form-radio-${(0, import_uid.uid)(5)}`, [id]);
|
|
75
75
|
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
76
|
+
const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
76
77
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
77
78
|
import_styles.StyledContainer,
|
|
78
79
|
{
|
|
@@ -81,6 +82,8 @@ const DSControlledRadio = (props) => {
|
|
|
81
82
|
hasLabel: Boolean(label),
|
|
82
83
|
className,
|
|
83
84
|
...xstyledProps,
|
|
85
|
+
getOwnerProps,
|
|
86
|
+
getOwnerPropsArguments,
|
|
84
87
|
children: [
|
|
85
88
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
89
|
import_styles.StyledRadio,
|
|
@@ -91,6 +94,8 @@ const DSControlledRadio = (props) => {
|
|
|
91
94
|
disabled,
|
|
92
95
|
applyAriaDisabled,
|
|
93
96
|
readOnly,
|
|
97
|
+
getOwnerProps,
|
|
98
|
+
getOwnerPropsArguments,
|
|
94
99
|
children: !visualOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
100
|
import_styles.StyledInput,
|
|
96
101
|
{
|
|
@@ -105,7 +110,9 @@ const DSControlledRadio = (props) => {
|
|
|
105
110
|
disabled,
|
|
106
111
|
"aria-disabled": applyAriaDisabled || readOnly,
|
|
107
112
|
"aria-invalid": hasError,
|
|
108
|
-
"aria-describedby": readOnly ? `${instanceUid}-read-only-helper-msg` : void 0
|
|
113
|
+
"aria-describedby": readOnly ? `${instanceUid}-read-only-helper-msg` : void 0,
|
|
114
|
+
getOwnerProps,
|
|
115
|
+
getOwnerPropsArguments
|
|
109
116
|
}
|
|
110
117
|
) : null
|
|
111
118
|
}
|
|
@@ -119,7 +126,25 @@ const DSControlledRadio = (props) => {
|
|
|
119
126
|
readOnly,
|
|
120
127
|
checked,
|
|
121
128
|
"data-testid": "ds-radio-label",
|
|
122
|
-
|
|
129
|
+
getOwnerProps,
|
|
130
|
+
getOwnerPropsArguments,
|
|
131
|
+
children: wrapLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
import_styles.StyledLabelTypography,
|
|
133
|
+
{
|
|
134
|
+
component: "span",
|
|
135
|
+
variant: "b2",
|
|
136
|
+
getOwnerProps,
|
|
137
|
+
getOwnerPropsArguments,
|
|
138
|
+
children: label
|
|
139
|
+
}
|
|
140
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
import_TruncatedTooltipText.TruncatedTooltipText,
|
|
142
|
+
{
|
|
143
|
+
value: label,
|
|
144
|
+
getOwnerProps,
|
|
145
|
+
getOwnerPropsArguments
|
|
146
|
+
}
|
|
147
|
+
)
|
|
123
148
|
}
|
|
124
149
|
),
|
|
125
150
|
readOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledHiddenP, { "data-testid": import_data_test_ids.DSRadioDataTestIds.READONLY_HELPER_MSG, id: `${instanceUid}-read-only-helper-msg`, children: "Read only" }) : null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ControlledRadio.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useCallback, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useCallback, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport {\n StyledContainer,\n StyledLabelTypography,\n StyledInput,\n StyledLabel,\n StyledRadio,\n StyledHiddenP,\n} from './styles.js';\nimport type { DSControlledRadioT } from './react-desc-prop-types.js';\nimport { DSControlledRadioPropTypes, DSControlledRadioPropTypesSchema, defaultProps } from './react-desc-prop-types.js';\nimport { useValidateProps } from './config/useValidateProps.js';\nimport { DSRadioDataTestIds } from './exported-related/data-test-ids.js';\n\nconst DSControlledRadio: React.ComponentType<DSControlledRadioT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledRadioT.InternalProps>(props, defaultProps);\n useValidateProps(props, DSControlledRadioPropTypes);\n const { checked, applyAriaDisabled, visualOnly, device, hasError, innerRef, value, wrapLabel, onChange } =\n propsWithDefault;\n\n const handleOnChange = useCallback(\n (e: React.ChangeEvent | React.KeyboardEvent) => {\n if (onChange && value && !applyAriaDisabled) onChange(value, e);\n },\n [applyAriaDisabled, onChange, value],\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Enter') handleOnChange(e);\n },\n [handleOnChange],\n );\n\n const sharedListeners = React.useMemo(\n () => ({\n onKeyDown: handleKeyDown,\n // we can't declare onChange here, we are \"overwriting\" the event,\n // if we put it here we invoke it twice, once with our overwritten arguments, once with the native ones\n // onChange: handleOnChange,\n }),\n [handleKeyDown],\n );\n const { id, disabled, readOnly, label, className, ...restGlobals } = useGetGlobalAttributes<DSControlledRadioT.Props>(\n propsWithDefault,\n sharedListeners,\n );\n\n const instanceUid = useMemo(() => id || `ds-form-radio-${uid(5)}`, [id]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n return (\n <StyledContainer\n device={device}\n data-testid=\"ds-radio-container\"\n hasLabel={Boolean(label)}\n className={className}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledRadio\n device={device}\n checked={checked}\n hasError={hasError}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {!visualOnly ? (\n <StyledInput\n data-testid=\"ds-radio\"\n type=\"radio\"\n {...sharedListeners}\n {...restGlobals}\n id={instanceUid}\n innerRef={innerRef}\n onChange={handleOnChange}\n checked={checked}\n disabled={disabled}\n aria-disabled={applyAriaDisabled || readOnly}\n aria-invalid={hasError}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ) : null}\n </StyledRadio>\n {label && (\n <StyledLabel\n device={device}\n htmlFor={instanceUid}\n disabled={disabled || applyAriaDisabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-radio-label\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapLabel ? (\n <StyledLabelTypography\n component=\"span\"\n variant=\"b2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledLabelTypography>\n ) : (\n <TruncatedTooltipText\n value={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </StyledLabel>\n )}\n {readOnly ? (\n <StyledHiddenP data-testid={DSRadioDataTestIds.READONLY_HELPER_MSG} id={`${instanceUid}-read-only-helper-msg`}>\n Read only\n </StyledHiddenP>\n ) : null}\n </StyledContainer>\n );\n};\n\nDSControlledRadio.displayName = 'DSControlledRadio';\nconst DSControlledRadioWithSchema = describe(DSControlledRadio);\nDSControlledRadioWithSchema.propTypes = DSControlledRadioPropTypesSchema;\n\nexport { DSControlledRadio, DSControlledRadioWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+DnB;AA9DJ,mBAA4C;AAC5C,8BAMO;AACP,iBAAoB;AACpB,kCAAqC;AACrC,oBAOO;AAEP,mCAA2F;AAC3F,8BAAiC;AACjC,2BAAmC;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,uBAAmB,sDAA+D,OAAO,yCAAY;AAC3G,gDAAiB,OAAO,uDAA0B;AAClD,QAAM,EAAE,SAAS,mBAAmB,YAAY,QAAQ,UAAU,UAAU,OAAO,WAAW,SAAS,IACrG;AAEF,QAAM,qBAAiB;AAAA,IACrB,CAAC,MAA+C;AAC9C,UAAI,YAAY,SAAS,CAAC,kBAAmB,UAAS,OAAO,CAAC;AAAA,IAChE;AAAA,IACA,CAAC,mBAAmB,UAAU,KAAK;AAAA,EACrC;AAEA,QAAM,oBAAgB;AAAA,IACpB,CAAC,MAA2B;AAC1B,UAAI,EAAE,QAAQ,QAAS,gBAAe,CAAC;AAAA,IACzC;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,kBAAkB,aAAAA,QAAM;AAAA,IAC5B,OAAO;AAAA,MACL,WAAW;AAAA;AAAA;AAAA;AAAA,IAIb;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AACA,QAAM,EAAE,IAAI,UAAU,UAAU,OAAO,WAAW,GAAG,YAAY,QAAI;AAAA,IACnE;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAc,sBAAQ,MAAM,MAAM,qBAAiB,gBAAI,CAAC,CAAC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,kBAAkB,cAAc;AAChC,MAAM,kCAA8B,kCAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -36,15 +36,23 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = require("react");
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
39
40
|
var import_ds_floating_context = require("@elliemae/ds-floating-context");
|
|
40
|
-
|
|
41
|
+
var import_exported_related = require("./exported-related/index.js");
|
|
42
|
+
const TruncatedSpan = (0, import_ds_system.styled)(import_ds_typography.DSTypography, {
|
|
43
|
+
name: import_exported_related.DSRadioName,
|
|
44
|
+
slot: import_exported_related.DSRadioSlots.TRUNCATED_LABEL
|
|
45
|
+
})`
|
|
41
46
|
text-overflow: ellipsis;
|
|
42
47
|
white-space: nowrap;
|
|
43
48
|
overflow: hidden;
|
|
44
49
|
display: inline-block;
|
|
45
50
|
max-width: 100%;
|
|
46
51
|
`;
|
|
47
|
-
const TooltipContainer = import_ds_system.styled
|
|
52
|
+
const TooltipContainer = (0, import_ds_system.styled)("div", {
|
|
53
|
+
name: import_exported_related.DSRadioName,
|
|
54
|
+
slot: import_exported_related.DSRadioSlots.TOOLTIP_CONTAINER
|
|
55
|
+
})`
|
|
48
56
|
text-align: center;
|
|
49
57
|
min-width: ${({ theme }) => theme.space.l};
|
|
50
58
|
max-width: 250px;
|
|
@@ -57,11 +65,19 @@ const TooltipContainer = import_ds_system.styled.div`
|
|
|
57
65
|
position: relative;
|
|
58
66
|
background-color: white;
|
|
59
67
|
border-radius: 2px;
|
|
60
|
-
font-size: 13px;
|
|
61
68
|
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
62
69
|
pointer-events: none;
|
|
63
70
|
`;
|
|
64
|
-
const
|
|
71
|
+
const StyledTooltipText = (0, import_ds_system.styled)(import_ds_typography.DSTypography, {
|
|
72
|
+
name: import_exported_related.DSRadioName,
|
|
73
|
+
slot: import_exported_related.DSRadioSlots.TOOLTIP_TEXT
|
|
74
|
+
})``;
|
|
75
|
+
const TruncatedTooltipText = ({
|
|
76
|
+
value = "",
|
|
77
|
+
placement = "top",
|
|
78
|
+
getOwnerProps,
|
|
79
|
+
getOwnerPropsArguments
|
|
80
|
+
}) => {
|
|
65
81
|
const [showTooltip, setShowTooltip] = (0, import_react.useState)(false);
|
|
66
82
|
const { refs, floatingStyles, arrowStyles, context } = (0, import_ds_floating_context.useFloatingContext)({
|
|
67
83
|
placement,
|
|
@@ -76,7 +92,20 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
76
92
|
setShowTooltip(false);
|
|
77
93
|
}, []);
|
|
78
94
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
79
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
TruncatedSpan,
|
|
97
|
+
{
|
|
98
|
+
component: "span",
|
|
99
|
+
variant: "b2",
|
|
100
|
+
"data-testid": import_exported_related.DSRadioDataTestIds.TRUNCATED_LABEL,
|
|
101
|
+
innerRef: refs.setReference,
|
|
102
|
+
onMouseEnter: handleMouseEnter,
|
|
103
|
+
onMouseLeave: handleMouseLeave,
|
|
104
|
+
getOwnerProps,
|
|
105
|
+
getOwnerPropsArguments,
|
|
106
|
+
children: value
|
|
107
|
+
}
|
|
108
|
+
),
|
|
80
109
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
110
|
import_ds_floating_context.FloatingWrapper,
|
|
82
111
|
{
|
|
@@ -84,8 +113,17 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
84
113
|
isOpen: showTooltip,
|
|
85
114
|
floatingStyles,
|
|
86
115
|
context,
|
|
87
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContainer, { children: [
|
|
88
|
-
|
|
116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContainer, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
118
|
+
StyledTooltipText,
|
|
119
|
+
{
|
|
120
|
+
component: "span",
|
|
121
|
+
variant: "b2-light",
|
|
122
|
+
getOwnerProps,
|
|
123
|
+
getOwnerPropsArguments,
|
|
124
|
+
children: value
|
|
125
|
+
}
|
|
126
|
+
),
|
|
89
127
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
|
|
90
128
|
] })
|
|
91
129
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/TruncatedTooltipText.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst TruncatedSpan = styled.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSRadioName, DSRadioSlots, DSRadioDataTestIds } from './exported-related/index.js';\n\nconst TruncatedSpan = styled(DSTypography, {\n name: DSRadioName,\n slot: DSRadioSlots.TRUNCATED_LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled('div', {\n name: DSRadioName,\n slot: DSRadioSlots.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled(DSTypography, {\n name: DSRadioName,\n slot: DSRadioSlots.TOOLTIP_TEXT,\n})``;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nconst TruncatedTooltipText = ({\n value = '',\n placement = 'top',\n getOwnerProps,\n getOwnerPropsArguments,\n}: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan\n component=\"span\"\n variant=\"b2\"\n data-testid={DSRadioDataTestIds.TRUNCATED_LABEL}\n innerRef={refs.setReference}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledTooltipText\n component=\"span\"\n variant=\"b2-light\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+EnB;AA/EJ,mBAA6C;AAC7C,uBAAuB;AACvB,2BAA6B;AAC7B,iCAKO;AACP,8BAA8D;AAE9D,MAAM,oBAAgB,yBAAO,mCAAc;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,qCAAa;AACrB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASD,MAAM,uBAAmB,yBAAO,OAAO;AAAA,EACrC,MAAM;AAAA,EACN,MAAM,qCAAa;AACrB,CAAC;AAAA;AAAA,eAEc,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAO9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA,WAIvD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAInD,MAAM,wBAAoB,yBAAO,mCAAc;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,qCAAa;AACrB,CAAC;AASD,MAAM,uBAAuB,CAAC;AAAA,EAC5B,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ;AAAA,EACA;AACF,MAAiC;AAC/B,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AAEpD,QAAM,EAAE,MAAM,gBAAgB,aAAa,QAAQ,QAAI,+CAAmB;AAAA,IACxE;AAAA,IACA,4BAA4B;AAAA,IAC5B,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,uBAAmB,0BAAY,CAAC,MAAyC;AAC7E,UAAM,KAAK,EAAE;AACb,mBAAe,GAAG,cAAc,GAAG,WAAW;AAAA,EAChD,GAAG,CAAC,CAAC;AAEL,QAAM,uBAAmB,0BAAY,MAAM;AACzC,mBAAe,KAAK;AAAA,EACtB,GAAG,CAAC,CAAC;AAEL,SACE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,eAAa,2CAAmB;AAAA,QAChC,UAAU,KAAK;AAAA,QACf,cAAc;AAAA,QACd,cAAc;AAAA,QACd;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,uDAAC,oBAAiB,eAA8B,wBAC9C;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR;AAAA,cACA;AAAA,cAEC;AAAA;AAAA,UACH;AAAA,UACA,4CAAC,2CAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -32,9 +32,14 @@ __export(data_test_ids_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(data_test_ids_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_theming = require("./theming.js");
|
|
35
37
|
const DSRadioDataTestIds = {
|
|
38
|
+
...(0, import_ds_system.slotObjectToDataTestIds)(import_theming.DSRadioName, import_theming.DSRadioSlots),
|
|
39
|
+
// for legacy reasons we have to keep those around and override the slots...
|
|
36
40
|
CONTAINER: "ds-radio-container",
|
|
37
41
|
INPUT: "ds-radio",
|
|
42
|
+
LABEL: "ds-radio-label",
|
|
38
43
|
READONLY_HELPER_MSG: "ds-radio-readonly-helper-msg"
|
|
39
44
|
};
|
|
40
45
|
//# sourceMappingURL=data-test-ids.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported-related/data-test-ids.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { DSRadioName, DSRadioSlots } from './theming.js';\n\nexport const DSRadioDataTestIds = {\n ...slotObjectToDataTestIds(DSRadioName, DSRadioSlots),\n // for legacy reasons we have to keep those around and override the slots...\n CONTAINER: 'ds-radio-container',\n INPUT: 'ds-radio',\n LABEL: 'ds-radio-label',\n READONLY_HELPER_MSG: 'ds-radio-readonly-helper-msg',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AACxC,qBAA0C;AAEnC,MAAM,qBAAqB;AAAA,EAChC,OAAG,0CAAwB,4BAAa,2BAAY;AAAA;AAAA,EAEpD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,qBAAqB;AACvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,6 +37,11 @@ const DSRadioName = "DSRadio";
|
|
|
37
37
|
const DSRadioSlots = {
|
|
38
38
|
CONTAINER: "root",
|
|
39
39
|
INPUT: "input",
|
|
40
|
-
|
|
40
|
+
INPUT_WRAPPER: "input-wrapper",
|
|
41
|
+
LABEL: "label",
|
|
42
|
+
LABEL_TYPOGRAPHY: "label-typography",
|
|
43
|
+
TRUNCATED_LABEL: "truncated-label",
|
|
44
|
+
TOOLTIP_CONTAINER: "tooltip-container",
|
|
45
|
+
TOOLTIP_TEXT: "tooltip-text"
|
|
41
46
|
};
|
|
42
47
|
//# sourceMappingURL=theming.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported-related/theming.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const DSRadioName = 'DSRadio';\n\nexport const DSRadioSlots = {\n CONTAINER: 'root',\n INPUT: 'input',\n LABEL: 'label',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,cAAc;AAEpB,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;
|
|
4
|
+
"sourcesContent": ["export const DSRadioName = 'DSRadio';\n\nexport const DSRadioSlots = {\n CONTAINER: 'root',\n INPUT: 'input',\n INPUT_WRAPPER: 'input-wrapper',\n LABEL: 'label',\n LABEL_TYPOGRAPHY: 'label-typography',\n TRUNCATED_LABEL: 'truncated-label',\n TOOLTIP_CONTAINER: 'tooltip-container',\n TOOLTIP_TEXT: 'tooltip-text',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,cAAc;AAEpB,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,OAAO;AAAA,EACP,eAAe;AAAA,EACf,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,cAAc;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nexport declare namespace DSControlledRadioT {\n export type Devices = 'mobile' | 'desktop' | 'mediaquery';\n export interface DefaultProps {\n checked: boolean;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n visualOnly: boolean;\n applyAriaDisabled: boolean;\n device: Devices;\n }\n export interface RequiredProps {\n name: string;\n value: string;\n }\n\n export interface OptionalProps {\n onChange?: (newValue: string, e: React.ChangeEvent | React.KeyboardEvent) => void;\n label?: string;\n innerRef?: React.RefObject<HTMLInputElement>;\n }\n\n export interface StyledRadioT {\n checked?: boolean;\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n device?: Devices;\n }\n\n export interface Props\n extends
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nexport declare namespace DSControlledRadioT {\n export type Devices = 'mobile' | 'desktop' | 'mediaquery';\n export interface DefaultProps {\n checked: boolean;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n visualOnly: boolean;\n applyAriaDisabled: boolean;\n device: Devices;\n }\n export interface RequiredProps {\n name: string;\n value: string;\n }\n\n export interface OptionalProps {\n onChange?: (newValue: string, e: React.ChangeEvent | React.KeyboardEvent) => void;\n label?: string;\n innerRef?: React.RefObject<HTMLInputElement>;\n }\n\n export interface StyledRadioT {\n checked?: boolean;\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n device?: Devices;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSControlledRadioT.DefaultProps = {\n wrapLabel: false,\n hasError: false,\n checked: false,\n disabled: false,\n visualOnly: false,\n applyAriaDisabled: false,\n device: 'mediaquery',\n};\n\n// Omit<DSControlledRadioT.Props, 'visualOnly'>\n// visualOnly is an internal only prop, so we don't want to expose it in the docs\nexport const DSControlledRadioPropTypes: DSPropTypesSchema<Omit<DSControlledRadioT.Props, 'visualOnly'>> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n name: PropTypes.string.description(\n 'Radio name attribute. Without this WCAG will fail, name is required for a bunch of success criterias',\n ),\n value: PropTypes.string.description(\n 'Radio value. Without this WCAG will fail, value is required for a bunch of success criterias',\n ),\n onChange: PropTypes.func\n .description('Radio onchange callback')\n .signature('((newValue: string,e: React.ChangeEvent | React.KeyboardEvent) => void)'),\n label: PropTypes.string.description(\n 'Radio Label property. This label is also going to be used as an aria-label for screen readers.',\n ),\n checked: PropTypes.bool.description('Whether the radio is checked or not'),\n hasError: PropTypes.bool.description('Whether the radio has error or not.'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Radio input ref.'),\n wrapLabel: PropTypes.bool.description('Whether to wrap or truncate the label'),\n device: PropTypes.oneOf(['mobile', 'desktop', 'mediaquery'])\n .description(\n 'used for responsive designs, this controls how the styling should behave. you can force mobile/desktop styling or rely on mediaquery to auto-detect',\n )\n .defaultValue('mediaquery'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION',\n )\n .defaultValue(false),\n};\n\nexport const DSControlledRadioPropTypesSchema =\n DSControlledRadioPropTypes as unknown as React.WeakValidationMap<DSControlledRadioT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAiDhE,MAAM,eAAgD;AAAA,EAC3D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,QAAQ;AACV;AAIO,MAAM,6BAA8F;AAAA,EACzG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,OAAO;AAAA,IACrB;AAAA,EACF;AAAA,EACA,OAAO,kCAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,KACjB,YAAY,yBAAyB,EACrC,UAAU,0EAA0E;AAAA,EACvF,OAAO,kCAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,SAAS,kCAAU,KAAK,YAAY,qCAAqC;AAAA,EACzE,UAAU,kCAAU,KAAK,YAAY,qCAAqC;AAAA,EAC1E,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE,YAAY,kBAAkB;AAAA,EAChG,WAAW,kCAAU,KAAK,YAAY,uCAAuC;AAAA,EAC7E,QAAQ,kCAAU,MAAM,CAAC,UAAU,WAAW,YAAY,CAAC,EACxD;AAAA,IACC;AAAA,EACF,EACC,aAAa,YAAY;AAAA,EAC5B,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,mCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -32,12 +32,13 @@ __export(styles_exports, {
|
|
|
32
32
|
StyledHiddenP: () => StyledHiddenP,
|
|
33
33
|
StyledInput: () => StyledInput,
|
|
34
34
|
StyledLabel: () => StyledLabel,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
StyledLabelTypography: () => StyledLabelTypography,
|
|
36
|
+
StyledRadio: () => StyledRadio
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(styles_exports);
|
|
39
39
|
var React = __toESM(require("react"));
|
|
40
40
|
var import_ds_system = require("@elliemae/ds-system");
|
|
41
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
41
42
|
var import_styleHelpers = require("./utils/styleHelpers.js");
|
|
42
43
|
var import_exported_related = require("./exported-related/index.js");
|
|
43
44
|
const StyledContainer = (0, import_ds_system.styled)("div", {
|
|
@@ -76,7 +77,10 @@ const StyledContainer = (0, import_ds_system.styled)("div", {
|
|
|
76
77
|
align-items: center;
|
|
77
78
|
${import_ds_system.xStyledCommonProps}
|
|
78
79
|
`;
|
|
79
|
-
const StyledRadio = (0, import_ds_system.styled)("span"
|
|
80
|
+
const StyledRadio = (0, import_ds_system.styled)("span", {
|
|
81
|
+
name: import_exported_related.DSRadioName,
|
|
82
|
+
slot: import_exported_related.DSRadioSlots.INPUT_WRAPPER
|
|
83
|
+
})`
|
|
80
84
|
${({ device, theme }) => {
|
|
81
85
|
if (device === "mobile") {
|
|
82
86
|
return `
|
|
@@ -153,32 +157,7 @@ const StyledLabel = (0, import_ds_system.styled)("label", {
|
|
|
153
157
|
slot: import_exported_related.DSRadioSlots.LABEL
|
|
154
158
|
})`
|
|
155
159
|
color: ${({ theme, disabled, readOnly }) => disabled || readOnly ? theme.colors.neutral[500] : theme.colors.neutral[800]};
|
|
156
|
-
|
|
157
|
-
@media (max-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
158
|
-
line-height: 1rem; /* 13px / 16 */
|
|
159
|
-
}
|
|
160
|
-
${({ device, theme }) => {
|
|
161
|
-
if (device === "mobile") {
|
|
162
|
-
return `
|
|
163
|
-
@media (max-width: ${theme.breakpoints.small}) {
|
|
164
|
-
font-size: 1rem; /* 16px / 16 */
|
|
165
|
-
}
|
|
166
|
-
font-size: 1.2307rem; /* 16px / 13 */
|
|
167
|
-
`;
|
|
168
|
-
}
|
|
169
|
-
if (device === void 0) {
|
|
170
|
-
return `
|
|
171
|
-
font-size: 1rem;
|
|
172
|
-
`;
|
|
173
|
-
}
|
|
174
|
-
return `
|
|
175
|
-
@media (max-width: ${theme.breakpoints.small}) {
|
|
176
|
-
font-size: 0.8125rem; /* 13px / 16 */
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
font-size: 1rem; /* 13px / 13 */
|
|
180
|
-
`;
|
|
181
|
-
}}
|
|
160
|
+
/* Typography metrics delegated to child DSTypography b2 */
|
|
182
161
|
display: inherit;
|
|
183
162
|
width: fit-content;
|
|
184
163
|
|
|
@@ -188,7 +167,10 @@ const StyledLabel = (0, import_ds_system.styled)("label", {
|
|
|
188
167
|
cursor: pointer;
|
|
189
168
|
}`}
|
|
190
169
|
`;
|
|
191
|
-
const
|
|
170
|
+
const StyledLabelTypography = (0, import_ds_system.styled)(import_ds_typography.DSTypography, {
|
|
171
|
+
name: import_exported_related.DSRadioName,
|
|
172
|
+
slot: import_exported_related.DSRadioSlots.LABEL_TYPOGRAPHY
|
|
173
|
+
})``;
|
|
192
174
|
const StyledHiddenP = import_ds_system.styled.p`
|
|
193
175
|
display: none;
|
|
194
176
|
`;
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled, css,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport type { DSControlledRadioT } from './react-desc-prop-types.js';\nimport { handleBackgroundColor, handleCheckmark } from './utils/styleHelpers.js';\nimport { DSRadioName, DSRadioSlots } from './exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSRadioName,\n slot: DSRadioSlots.CONTAINER,\n})<{ device?: DSControlledRadioT.Devices; hasLabel: boolean }>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto; /* 24px / 16px */\n }\n grid-template-columns: 1.846rem auto;\n `;\n }\n if (device === 'mediaquery') {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto;\n }\n grid-template-columns: 1.23rem auto;\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1rem auto; /* 16px / 16px */\n }\n grid-template-columns: 1.2307rem auto; /* 16px / 13 */\n\n `;\n }}\n ${({ hasLabel }) => (hasLabel ? 'column-gap: 8px;' : '')}\n display: inline-grid;\n grid-template-rows: min-content;\n\n align-items: center;\n ${xStyledCommonProps}\n`;\n\nexport const StyledRadio = styled('span', {\n name: DSRadioName,\n slot: DSRadioSlots.INPUT_WRAPPER,\n})<DSControlledRadioT.StyledRadioT>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.846rem; /* 24px / 13 */\n height: 1.846rem; /* 24px / 13 */`;\n }\n if (device === 'mediaquery') {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.2307rem; /* 16px / 13 */\n height: 1.2307rem; /* 16px / 13 */\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1rem; /* 16px / 16 */\n height: 1rem; /* 16px / 16 */\n }\n width: 1.2307rem; /* 16px / 13 */\n height: 1.2307rem; /* 16px / 13 */\n `;\n }}\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n border-radius: 50px;\n position: relative;\n background: ${({ theme, disabled, applyAriaDisabled, readOnly }) =>\n handleBackgroundColor(theme, disabled, readOnly || applyAriaDisabled)};\n ${({ theme, checked, disabled, applyAriaDisabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled || applyAriaDisabled, readOnly, hasError, false, device)}\n &:focus-within {\n ${({ theme, disabled }) =>\n !disabled\n ? `border: 1px solid ${theme.colors.brand[700]};\n outline: 1px solid ${theme.colors.brand[700]}`\n : undefined};\n &:hover {\n ${({ theme, checked, disabled, applyAriaDisabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled || applyAriaDisabled, readOnly, hasError, true, device)}\n }\n }\n &:hover {\n background: ${({ theme, applyAriaDisabled, readOnly, disabled }) => {\n if (applyAriaDisabled || readOnly) {\n return theme.colors.neutral['050'];\n }\n return !disabled && !applyAriaDisabled ? theme.colors.brand[200] : undefined;\n }};\n ${({ theme, hasError, disabled }) =>\n !hasError && !disabled ? ` border: 1px solid ${theme.colors.brand[600]}` : undefined};\n }\n`;\n\nconst radioStyles = css`\n &:hover {\n cursor: pointer;\n }\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n`;\n\nexport const StyledInput = styled('input', {\n name: DSRadioName,\n slot: DSRadioSlots.INPUT,\n})`\n ${radioStyles}\n &:disabled, &[aria-disabled='true'] {\n cursor: not-allowed;\n }\n`;\ninterface StyledLabelT {\n disabled?: boolean;\n readOnly?: boolean;\n checked: boolean;\n onClick?: React.MouseEventHandler<HTMLLabelElement>;\n device?: DSControlledRadioT.Devices;\n}\nexport const StyledLabel = styled('label', {\n name: DSRadioName,\n slot: DSRadioSlots.LABEL,\n})<StyledLabelT>`\n color: ${({ theme, disabled, readOnly }) =>\n disabled || readOnly ? theme.colors.neutral[500] : theme.colors.neutral[800]};\n /* Typography metrics delegated to child DSTypography b2 */\n display: inherit;\n width: fit-content;\n\n ${({ disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : `&:hover {\n cursor: pointer;\n }`}\n`;\n\nexport const StyledLabelTypography = styled(DSTypography, {\n name: DSRadioName,\n slot: DSRadioSlots.LABEL_TYPOGRAPHY,\n})``;\n\nexport const StyledHiddenP = styled.p`\n display: none;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAgD;AAChD,2BAA6B;AAE7B,0BAAuD;AACvD,8BAA0C;AAEnC,MAAM,sBAAkB,yBAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,qCAAa;AACrB,CAAC;AAAA,IACG,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,WAAW,UAAU;AACvB,WAAO;AAAA,2BACc,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAK9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
|
|
@@ -5,11 +5,19 @@ import {
|
|
|
5
5
|
describe,
|
|
6
6
|
useGetGlobalAttributes,
|
|
7
7
|
useGetXstyledProps,
|
|
8
|
-
useMemoMergePropsWithDefault
|
|
8
|
+
useMemoMergePropsWithDefault,
|
|
9
|
+
useOwnerProps
|
|
9
10
|
} from "@elliemae/ds-props-helpers";
|
|
10
11
|
import { uid } from "uid";
|
|
11
12
|
import { TruncatedTooltipText } from "./TruncatedTooltipText.js";
|
|
12
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
StyledContainer,
|
|
15
|
+
StyledLabelTypography,
|
|
16
|
+
StyledInput,
|
|
17
|
+
StyledLabel,
|
|
18
|
+
StyledRadio,
|
|
19
|
+
StyledHiddenP
|
|
20
|
+
} from "./styles.js";
|
|
13
21
|
import { DSControlledRadioPropTypes, DSControlledRadioPropTypesSchema, defaultProps } from "./react-desc-prop-types.js";
|
|
14
22
|
import { useValidateProps } from "./config/useValidateProps.js";
|
|
15
23
|
import { DSRadioDataTestIds } from "./exported-related/data-test-ids.js";
|
|
@@ -44,6 +52,7 @@ const DSControlledRadio = (props) => {
|
|
|
44
52
|
);
|
|
45
53
|
const instanceUid = useMemo(() => id || `ds-form-radio-${uid(5)}`, [id]);
|
|
46
54
|
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
55
|
+
const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);
|
|
47
56
|
return /* @__PURE__ */ jsxs(
|
|
48
57
|
StyledContainer,
|
|
49
58
|
{
|
|
@@ -52,6 +61,8 @@ const DSControlledRadio = (props) => {
|
|
|
52
61
|
hasLabel: Boolean(label),
|
|
53
62
|
className,
|
|
54
63
|
...xstyledProps,
|
|
64
|
+
getOwnerProps,
|
|
65
|
+
getOwnerPropsArguments,
|
|
55
66
|
children: [
|
|
56
67
|
/* @__PURE__ */ jsx(
|
|
57
68
|
StyledRadio,
|
|
@@ -62,6 +73,8 @@ const DSControlledRadio = (props) => {
|
|
|
62
73
|
disabled,
|
|
63
74
|
applyAriaDisabled,
|
|
64
75
|
readOnly,
|
|
76
|
+
getOwnerProps,
|
|
77
|
+
getOwnerPropsArguments,
|
|
65
78
|
children: !visualOnly ? /* @__PURE__ */ jsx(
|
|
66
79
|
StyledInput,
|
|
67
80
|
{
|
|
@@ -76,7 +89,9 @@ const DSControlledRadio = (props) => {
|
|
|
76
89
|
disabled,
|
|
77
90
|
"aria-disabled": applyAriaDisabled || readOnly,
|
|
78
91
|
"aria-invalid": hasError,
|
|
79
|
-
"aria-describedby": readOnly ? `${instanceUid}-read-only-helper-msg` : void 0
|
|
92
|
+
"aria-describedby": readOnly ? `${instanceUid}-read-only-helper-msg` : void 0,
|
|
93
|
+
getOwnerProps,
|
|
94
|
+
getOwnerPropsArguments
|
|
80
95
|
}
|
|
81
96
|
) : null
|
|
82
97
|
}
|
|
@@ -90,7 +105,25 @@ const DSControlledRadio = (props) => {
|
|
|
90
105
|
readOnly,
|
|
91
106
|
checked,
|
|
92
107
|
"data-testid": "ds-radio-label",
|
|
93
|
-
|
|
108
|
+
getOwnerProps,
|
|
109
|
+
getOwnerPropsArguments,
|
|
110
|
+
children: wrapLabel ? /* @__PURE__ */ jsx(
|
|
111
|
+
StyledLabelTypography,
|
|
112
|
+
{
|
|
113
|
+
component: "span",
|
|
114
|
+
variant: "b2",
|
|
115
|
+
getOwnerProps,
|
|
116
|
+
getOwnerPropsArguments,
|
|
117
|
+
children: label
|
|
118
|
+
}
|
|
119
|
+
) : /* @__PURE__ */ jsx(
|
|
120
|
+
TruncatedTooltipText,
|
|
121
|
+
{
|
|
122
|
+
value: label,
|
|
123
|
+
getOwnerProps,
|
|
124
|
+
getOwnerPropsArguments
|
|
125
|
+
}
|
|
126
|
+
)
|
|
94
127
|
}
|
|
95
128
|
),
|
|
96
129
|
readOnly ? /* @__PURE__ */ jsx(StyledHiddenP, { "data-testid": DSRadioDataTestIds.READONLY_HELPER_MSG, id: `${instanceUid}-read-only-helper-msg`, children: "Read only" }) : null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ControlledRadio.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useCallback, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useCallback, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport {\n StyledContainer,\n StyledLabelTypography,\n StyledInput,\n StyledLabel,\n StyledRadio,\n StyledHiddenP,\n} from './styles.js';\nimport type { DSControlledRadioT } from './react-desc-prop-types.js';\nimport { DSControlledRadioPropTypes, DSControlledRadioPropTypesSchema, defaultProps } from './react-desc-prop-types.js';\nimport { useValidateProps } from './config/useValidateProps.js';\nimport { DSRadioDataTestIds } from './exported-related/data-test-ids.js';\n\nconst DSControlledRadio: React.ComponentType<DSControlledRadioT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledRadioT.InternalProps>(props, defaultProps);\n useValidateProps(props, DSControlledRadioPropTypes);\n const { checked, applyAriaDisabled, visualOnly, device, hasError, innerRef, value, wrapLabel, onChange } =\n propsWithDefault;\n\n const handleOnChange = useCallback(\n (e: React.ChangeEvent | React.KeyboardEvent) => {\n if (onChange && value && !applyAriaDisabled) onChange(value, e);\n },\n [applyAriaDisabled, onChange, value],\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Enter') handleOnChange(e);\n },\n [handleOnChange],\n );\n\n const sharedListeners = React.useMemo(\n () => ({\n onKeyDown: handleKeyDown,\n // we can't declare onChange here, we are \"overwriting\" the event,\n // if we put it here we invoke it twice, once with our overwritten arguments, once with the native ones\n // onChange: handleOnChange,\n }),\n [handleKeyDown],\n );\n const { id, disabled, readOnly, label, className, ...restGlobals } = useGetGlobalAttributes<DSControlledRadioT.Props>(\n propsWithDefault,\n sharedListeners,\n );\n\n const instanceUid = useMemo(() => id || `ds-form-radio-${uid(5)}`, [id]);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n return (\n <StyledContainer\n device={device}\n data-testid=\"ds-radio-container\"\n hasLabel={Boolean(label)}\n className={className}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledRadio\n device={device}\n checked={checked}\n hasError={hasError}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {!visualOnly ? (\n <StyledInput\n data-testid=\"ds-radio\"\n type=\"radio\"\n {...sharedListeners}\n {...restGlobals}\n id={instanceUid}\n innerRef={innerRef}\n onChange={handleOnChange}\n checked={checked}\n disabled={disabled}\n aria-disabled={applyAriaDisabled || readOnly}\n aria-invalid={hasError}\n aria-describedby={readOnly ? `${instanceUid}-read-only-helper-msg` : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ) : null}\n </StyledRadio>\n {label && (\n <StyledLabel\n device={device}\n htmlFor={instanceUid}\n disabled={disabled || applyAriaDisabled}\n readOnly={readOnly}\n checked={checked}\n data-testid=\"ds-radio-label\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapLabel ? (\n <StyledLabelTypography\n component=\"span\"\n variant=\"b2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledLabelTypography>\n ) : (\n <TruncatedTooltipText\n value={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </StyledLabel>\n )}\n {readOnly ? (\n <StyledHiddenP data-testid={DSRadioDataTestIds.READONLY_HELPER_MSG} id={`${instanceUid}-read-only-helper-msg`}>\n Read only\n </StyledHiddenP>\n ) : null}\n </StyledContainer>\n );\n};\n\nDSControlledRadio.displayName = 'DSControlledRadio';\nconst DSControlledRadioWithSchema = describe(DSControlledRadio);\nDSControlledRadioWithSchema.propTypes = DSControlledRadioPropTypesSchema;\n\nexport { DSControlledRadio, DSControlledRadioWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+DnB,SAoBM,KApBN;AA9DJ,OAAOA,UAAS,aAAa,eAAe;AAC5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW;AACpB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,4BAA4B,kCAAkC,oBAAoB;AAC3F,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AAEnC,MAAM,oBAAmE,CAAC,UAAU;AAClF,QAAM,mBAAmB,6BAA+D,OAAO,YAAY;AAC3G,mBAAiB,OAAO,0BAA0B;AAClD,QAAM,EAAE,SAAS,mBAAmB,YAAY,QAAQ,UAAU,UAAU,OAAO,WAAW,SAAS,IACrG;AAEF,QAAM,iBAAiB;AAAA,IACrB,CAAC,MAA+C;AAC9C,UAAI,YAAY,SAAS,CAAC,kBAAmB,UAAS,OAAO,CAAC;AAAA,IAChE;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AAA;AAAA,YACC;AAAA,YACA,SAAS;AAAA,YACT,UAAU,YAAY;AAAA,YACtB;AAAA,YACA;AAAA,YACA,eAAY;AAAA,YACZ;AAAA,YACA;AAAA,YAEC,sBACC;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBAEC;AAAA;AAAA,YACH,IAEA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP;AAAA,gBACA;AAAA;AAAA,YACF;AAAA;AAAA,QAEJ;AAAA,QAED,WACC,oBAAC,iBAAc,eAAa,mBAAmB,qBAAqB,IAAI,GAAG,WAAW,yBAAyB,uBAE/G,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AAEA,kBAAkB,cAAc;AAChC,MAAM,8BAA8B,SAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,19 +2,27 @@ import * as React from "react";
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import { styled } from "@elliemae/ds-system";
|
|
5
|
+
import { DSTypography } from "@elliemae/ds-typography";
|
|
5
6
|
import {
|
|
6
7
|
useFloatingContext,
|
|
7
8
|
FloatingWrapper,
|
|
8
9
|
PopoverArrow
|
|
9
10
|
} from "@elliemae/ds-floating-context";
|
|
10
|
-
|
|
11
|
+
import { DSRadioName, DSRadioSlots, DSRadioDataTestIds } from "./exported-related/index.js";
|
|
12
|
+
const TruncatedSpan = styled(DSTypography, {
|
|
13
|
+
name: DSRadioName,
|
|
14
|
+
slot: DSRadioSlots.TRUNCATED_LABEL
|
|
15
|
+
})`
|
|
11
16
|
text-overflow: ellipsis;
|
|
12
17
|
white-space: nowrap;
|
|
13
18
|
overflow: hidden;
|
|
14
19
|
display: inline-block;
|
|
15
20
|
max-width: 100%;
|
|
16
21
|
`;
|
|
17
|
-
const TooltipContainer = styled
|
|
22
|
+
const TooltipContainer = styled("div", {
|
|
23
|
+
name: DSRadioName,
|
|
24
|
+
slot: DSRadioSlots.TOOLTIP_CONTAINER
|
|
25
|
+
})`
|
|
18
26
|
text-align: center;
|
|
19
27
|
min-width: ${({ theme }) => theme.space.l};
|
|
20
28
|
max-width: 250px;
|
|
@@ -27,11 +35,19 @@ const TooltipContainer = styled.div`
|
|
|
27
35
|
position: relative;
|
|
28
36
|
background-color: white;
|
|
29
37
|
border-radius: 2px;
|
|
30
|
-
font-size: 13px;
|
|
31
38
|
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
32
39
|
pointer-events: none;
|
|
33
40
|
`;
|
|
34
|
-
const
|
|
41
|
+
const StyledTooltipText = styled(DSTypography, {
|
|
42
|
+
name: DSRadioName,
|
|
43
|
+
slot: DSRadioSlots.TOOLTIP_TEXT
|
|
44
|
+
})``;
|
|
45
|
+
const TruncatedTooltipText = ({
|
|
46
|
+
value = "",
|
|
47
|
+
placement = "top",
|
|
48
|
+
getOwnerProps,
|
|
49
|
+
getOwnerPropsArguments
|
|
50
|
+
}) => {
|
|
35
51
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
36
52
|
const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({
|
|
37
53
|
placement,
|
|
@@ -46,7 +62,20 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
46
62
|
setShowTooltip(false);
|
|
47
63
|
}, []);
|
|
48
64
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
TruncatedSpan,
|
|
67
|
+
{
|
|
68
|
+
component: "span",
|
|
69
|
+
variant: "b2",
|
|
70
|
+
"data-testid": DSRadioDataTestIds.TRUNCATED_LABEL,
|
|
71
|
+
innerRef: refs.setReference,
|
|
72
|
+
onMouseEnter: handleMouseEnter,
|
|
73
|
+
onMouseLeave: handleMouseLeave,
|
|
74
|
+
getOwnerProps,
|
|
75
|
+
getOwnerPropsArguments,
|
|
76
|
+
children: value
|
|
77
|
+
}
|
|
78
|
+
),
|
|
50
79
|
/* @__PURE__ */ jsx(
|
|
51
80
|
FloatingWrapper,
|
|
52
81
|
{
|
|
@@ -54,8 +83,17 @@ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
|
|
|
54
83
|
isOpen: showTooltip,
|
|
55
84
|
floatingStyles,
|
|
56
85
|
context,
|
|
57
|
-
children: /* @__PURE__ */ jsxs(TooltipContainer, { children: [
|
|
58
|
-
|
|
86
|
+
children: /* @__PURE__ */ jsxs(TooltipContainer, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
StyledTooltipText,
|
|
89
|
+
{
|
|
90
|
+
component: "span",
|
|
91
|
+
variant: "b2-light",
|
|
92
|
+
getOwnerProps,
|
|
93
|
+
getOwnerPropsArguments,
|
|
94
|
+
children: value
|
|
95
|
+
}
|
|
96
|
+
),
|
|
59
97
|
/* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles })
|
|
60
98
|
] })
|
|
61
99
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TruncatedTooltipText.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst TruncatedSpan = styled.
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\nimport { DSRadioName, DSRadioSlots, DSRadioDataTestIds } from './exported-related/index.js';\n\nconst TruncatedSpan = styled(DSTypography, {\n name: DSRadioName,\n slot: DSRadioSlots.TRUNCATED_LABEL,\n})`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled('div', {\n name: DSRadioName,\n slot: DSRadioSlots.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n pointer-events: none;\n`;\n\nconst StyledTooltipText = styled(DSTypography, {\n name: DSRadioName,\n slot: DSRadioSlots.TOOLTIP_TEXT,\n})``;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nconst TruncatedTooltipText = ({\n value = '',\n placement = 'top',\n getOwnerProps,\n getOwnerPropsArguments,\n}: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan\n component=\"span\"\n variant=\"b2\"\n data-testid={DSRadioDataTestIds.TRUNCATED_LABEL}\n innerRef={refs.setReference}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledTooltipText\n component=\"span\"\n variant=\"b2-light\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </StyledTooltipText>\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+EnB,mBACE,KAkBE,YAnBJ;AA/EJ,SAAgB,aAAa,gBAAgB;AAC7C,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,aAAa,cAAc,0BAA0B;AAE9D,MAAM,gBAAgB,OAAO,cAAc;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASD,MAAM,mBAAmB,OAAO,OAAO;AAAA,EACrC,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAAA;AAAA,eAEc,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAO9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA,WAIvD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO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|
1
1
|
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
import { DSRadioName, DSRadioSlots } from "./theming.js";
|
|
2
4
|
const DSRadioDataTestIds = {
|
|
5
|
+
...slotObjectToDataTestIds(DSRadioName, DSRadioSlots),
|
|
6
|
+
// for legacy reasons we have to keep those around and override the slots...
|
|
3
7
|
CONTAINER: "ds-radio-container",
|
|
4
8
|
INPUT: "ds-radio",
|
|
9
|
+
LABEL: "ds-radio-label",
|
|
5
10
|
READONLY_HELPER_MSG: "ds-radio-readonly-helper-msg"
|
|
6
11
|
};
|
|
7
12
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/data-test-ids.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { DSRadioName, DSRadioSlots } from './theming.js';\n\nexport const DSRadioDataTestIds = {\n ...slotObjectToDataTestIds(DSRadioName, DSRadioSlots),\n // for legacy reasons we have to keep those around and override the slots...\n CONTAINER: 'ds-radio-container',\n INPUT: 'ds-radio',\n LABEL: 'ds-radio-label',\n READONLY_HELPER_MSG: 'ds-radio-readonly-helper-msg',\n} as const;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,aAAa,oBAAoB;AAEnC,MAAM,qBAAqB;AAAA,EAChC,GAAG,wBAAwB,aAAa,YAAY;AAAA;AAAA,EAEpD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,qBAAqB;AACvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,12 @@ const DSRadioName = "DSRadio";
|
|
|
3
3
|
const DSRadioSlots = {
|
|
4
4
|
CONTAINER: "root",
|
|
5
5
|
INPUT: "input",
|
|
6
|
-
|
|
6
|
+
INPUT_WRAPPER: "input-wrapper",
|
|
7
|
+
LABEL: "label",
|
|
8
|
+
LABEL_TYPOGRAPHY: "label-typography",
|
|
9
|
+
TRUNCATED_LABEL: "truncated-label",
|
|
10
|
+
TOOLTIP_CONTAINER: "tooltip-container",
|
|
11
|
+
TOOLTIP_TEXT: "tooltip-text"
|
|
7
12
|
};
|
|
8
13
|
export {
|
|
9
14
|
DSRadioName,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/theming.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSRadioName = 'DSRadio';\n\nexport const DSRadioSlots = {\n CONTAINER: 'root',\n INPUT: 'input',\n LABEL: 'label',\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,cAAc;AAEpB,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSRadioName = 'DSRadio';\n\nexport const DSRadioSlots = {\n CONTAINER: 'root',\n INPUT: 'input',\n INPUT_WRAPPER: 'input-wrapper',\n LABEL: 'label',\n LABEL_TYPOGRAPHY: 'label-typography',\n TRUNCATED_LABEL: 'truncated-label',\n TOOLTIP_CONTAINER: 'tooltip-container',\n TOOLTIP_TEXT: 'tooltip-text',\n} as const;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,cAAc;AAEpB,MAAM,eAAe;AAAA,EAC1B,WAAW;AAAA,EACX,OAAO;AAAA,EACP,eAAe;AAAA,EACf,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,cAAc;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nexport declare namespace DSControlledRadioT {\n export type Devices = 'mobile' | 'desktop' | 'mediaquery';\n export interface DefaultProps {\n checked: boolean;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n visualOnly: boolean;\n applyAriaDisabled: boolean;\n device: Devices;\n }\n export interface RequiredProps {\n name: string;\n value: string;\n }\n\n export interface OptionalProps {\n onChange?: (newValue: string, e: React.ChangeEvent | React.KeyboardEvent) => void;\n label?: string;\n innerRef?: React.RefObject<HTMLInputElement>;\n }\n\n export interface StyledRadioT {\n checked?: boolean;\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n device?: Devices;\n }\n\n export interface Props\n extends
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nexport declare namespace DSControlledRadioT {\n export type Devices = 'mobile' | 'desktop' | 'mediaquery';\n export interface DefaultProps {\n checked: boolean;\n hasError: boolean;\n wrapLabel: boolean;\n disabled: boolean;\n visualOnly: boolean;\n applyAriaDisabled: boolean;\n device: Devices;\n }\n export interface RequiredProps {\n name: string;\n value: string;\n }\n\n export interface OptionalProps {\n onChange?: (newValue: string, e: React.ChangeEvent | React.KeyboardEvent) => void;\n label?: string;\n innerRef?: React.RefObject<HTMLInputElement>;\n }\n\n export interface StyledRadioT {\n checked?: boolean;\n readOnly?: boolean;\n hasError?: boolean;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n device?: Devices;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSControlledRadioT.DefaultProps = {\n wrapLabel: false,\n hasError: false,\n checked: false,\n disabled: false,\n visualOnly: false,\n applyAriaDisabled: false,\n device: 'mediaquery',\n};\n\n// Omit<DSControlledRadioT.Props, 'visualOnly'>\n// visualOnly is an internal only prop, so we don't want to expose it in the docs\nexport const DSControlledRadioPropTypes: DSPropTypesSchema<Omit<DSControlledRadioT.Props, 'visualOnly'>> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n name: PropTypes.string.description(\n 'Radio name attribute. Without this WCAG will fail, name is required for a bunch of success criterias',\n ),\n value: PropTypes.string.description(\n 'Radio value. Without this WCAG will fail, value is required for a bunch of success criterias',\n ),\n onChange: PropTypes.func\n .description('Radio onchange callback')\n .signature('((newValue: string,e: React.ChangeEvent | React.KeyboardEvent) => void)'),\n label: PropTypes.string.description(\n 'Radio Label property. This label is also going to be used as an aria-label for screen readers.',\n ),\n checked: PropTypes.bool.description('Whether the radio is checked or not'),\n hasError: PropTypes.bool.description('Whether the radio has error or not.'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Radio input ref.'),\n wrapLabel: PropTypes.bool.description('Whether to wrap or truncate the label'),\n device: PropTypes.oneOf(['mobile', 'desktop', 'mediaquery'])\n .description(\n 'used for responsive designs, this controls how the styling should behave. you can force mobile/desktop styling or rely on mediaquery to auto-detect',\n )\n .defaultValue('mediaquery'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION',\n )\n .defaultValue(false),\n};\n\nexport const DSControlledRadioPropTypesSchema =\n DSControlledRadioPropTypes as unknown as React.WeakValidationMap<DSControlledRadioT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AAiDhE,MAAM,eAAgD;AAAA,EAC3D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,QAAQ;AACV;AAIO,MAAM,6BAA8F;AAAA,EACzG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,OAAO;AAAA,IACrB;AAAA,EACF;AAAA,EACA,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,UAAU,UAAU,KACjB,YAAY,yBAAyB,EACrC,UAAU,0EAA0E;AAAA,EACvF,OAAO,UAAU,OAAO;AAAA,IACtB;AAAA,EACF;AAAA,EACA,SAAS,UAAU,KAAK,YAAY,qCAAqC;AAAA,EACzE,UAAU,UAAU,KAAK,YAAY,qCAAqC;AAAA,EAC1E,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,kBAAkB;AAAA,EAChG,WAAW,UAAU,KAAK,YAAY,uCAAuC;AAAA,EAC7E,QAAQ,UAAU,MAAM,CAAC,UAAU,WAAW,YAAY,CAAC,EACxD;AAAA,IACC;AAAA,EACF,EACC,aAAa,YAAY;AAAA,EAC5B,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,mCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styles.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled, css,
|
|
2
|
+
import { styled, css, xStyledCommonProps } from "@elliemae/ds-system";
|
|
3
|
+
import { DSTypography } from "@elliemae/ds-typography";
|
|
3
4
|
import { handleBackgroundColor, handleCheckmark } from "./utils/styleHelpers.js";
|
|
4
5
|
import { DSRadioName, DSRadioSlots } from "./exported-related/index.js";
|
|
5
6
|
const StyledContainer = styled("div", {
|
|
@@ -38,7 +39,10 @@ const StyledContainer = styled("div", {
|
|
|
38
39
|
align-items: center;
|
|
39
40
|
${xStyledCommonProps}
|
|
40
41
|
`;
|
|
41
|
-
const StyledRadio = styled("span"
|
|
42
|
+
const StyledRadio = styled("span", {
|
|
43
|
+
name: DSRadioName,
|
|
44
|
+
slot: DSRadioSlots.INPUT_WRAPPER
|
|
45
|
+
})`
|
|
42
46
|
${({ device, theme }) => {
|
|
43
47
|
if (device === "mobile") {
|
|
44
48
|
return `
|
|
@@ -115,32 +119,7 @@ const StyledLabel = styled("label", {
|
|
|
115
119
|
slot: DSRadioSlots.LABEL
|
|
116
120
|
})`
|
|
117
121
|
color: ${({ theme, disabled, readOnly }) => disabled || readOnly ? theme.colors.neutral[500] : theme.colors.neutral[800]};
|
|
118
|
-
|
|
119
|
-
@media (max-width: ${th.breakpoint("small")}) {
|
|
120
|
-
line-height: 1rem; /* 13px / 16 */
|
|
121
|
-
}
|
|
122
|
-
${({ device, theme }) => {
|
|
123
|
-
if (device === "mobile") {
|
|
124
|
-
return `
|
|
125
|
-
@media (max-width: ${theme.breakpoints.small}) {
|
|
126
|
-
font-size: 1rem; /* 16px / 16 */
|
|
127
|
-
}
|
|
128
|
-
font-size: 1.2307rem; /* 16px / 13 */
|
|
129
|
-
`;
|
|
130
|
-
}
|
|
131
|
-
if (device === void 0) {
|
|
132
|
-
return `
|
|
133
|
-
font-size: 1rem;
|
|
134
|
-
`;
|
|
135
|
-
}
|
|
136
|
-
return `
|
|
137
|
-
@media (max-width: ${theme.breakpoints.small}) {
|
|
138
|
-
font-size: 0.8125rem; /* 13px / 16 */
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
font-size: 1rem; /* 13px / 13 */
|
|
142
|
-
`;
|
|
143
|
-
}}
|
|
122
|
+
/* Typography metrics delegated to child DSTypography b2 */
|
|
144
123
|
display: inherit;
|
|
145
124
|
width: fit-content;
|
|
146
125
|
|
|
@@ -150,7 +129,10 @@ const StyledLabel = styled("label", {
|
|
|
150
129
|
cursor: pointer;
|
|
151
130
|
}`}
|
|
152
131
|
`;
|
|
153
|
-
const
|
|
132
|
+
const StyledLabelTypography = styled(DSTypography, {
|
|
133
|
+
name: DSRadioName,
|
|
134
|
+
slot: DSRadioSlots.LABEL_TYPOGRAPHY
|
|
135
|
+
})``;
|
|
154
136
|
const StyledHiddenP = styled.p`
|
|
155
137
|
display: none;
|
|
156
138
|
`;
|
|
@@ -159,7 +141,7 @@ export {
|
|
|
159
141
|
StyledHiddenP,
|
|
160
142
|
StyledInput,
|
|
161
143
|
StyledLabel,
|
|
162
|
-
|
|
163
|
-
|
|
144
|
+
StyledLabelTypography,
|
|
145
|
+
StyledRadio
|
|
164
146
|
};
|
|
165
147
|
//# sourceMappingURL=styles.js.map
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css,
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,KAAK,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport type { DSControlledRadioT } from './react-desc-prop-types.js';\nimport { handleBackgroundColor, handleCheckmark } from './utils/styleHelpers.js';\nimport { DSRadioName, DSRadioSlots } from './exported-related/index.js';\n\nexport const StyledContainer = styled('div', {\n name: DSRadioName,\n slot: DSRadioSlots.CONTAINER,\n})<{ device?: DSControlledRadioT.Devices; hasLabel: boolean }>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto; /* 24px / 16px */\n }\n grid-template-columns: 1.846rem auto;\n `;\n }\n if (device === 'mediaquery') {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1.5rem auto;\n }\n grid-template-columns: 1.23rem auto;\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n grid-template-columns: 1rem auto; /* 16px / 16px */\n }\n grid-template-columns: 1.2307rem auto; /* 16px / 13 */\n\n `;\n }}\n ${({ hasLabel }) => (hasLabel ? 'column-gap: 8px;' : '')}\n display: inline-grid;\n grid-template-rows: min-content;\n\n align-items: center;\n ${xStyledCommonProps}\n`;\n\nexport const StyledRadio = styled('span', {\n name: DSRadioName,\n slot: DSRadioSlots.INPUT_WRAPPER,\n})<DSControlledRadioT.StyledRadioT>`\n ${({ device, theme }) => {\n if (device === 'mobile') {\n return ` \n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.846rem; /* 24px / 13 */\n height: 1.846rem; /* 24px / 13 */`;\n }\n if (device === 'mediaquery') {\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1.5rem; /* 24px / 16 */\n height: 1.5rem; /* 24px / 16 */\n }\n width: 1.2307rem; /* 16px / 13 */\n height: 1.2307rem; /* 16px / 13 */\n `;\n }\n return `\n @media (max-width: ${theme.breakpoints.small}) {\n width: 1rem; /* 16px / 16 */\n height: 1rem; /* 16px / 16 */\n }\n width: 1.2307rem; /* 16px / 13 */\n height: 1.2307rem; /* 16px / 13 */\n `;\n }}\n border: 1px solid ${({ theme, hasError }) => (hasError ? theme.colors.danger[900] : theme.colors.neutral[400])};\n border-radius: 50px;\n position: relative;\n background: ${({ theme, disabled, applyAriaDisabled, readOnly }) =>\n handleBackgroundColor(theme, disabled, readOnly || applyAriaDisabled)};\n ${({ theme, checked, disabled, applyAriaDisabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled || applyAriaDisabled, readOnly, hasError, false, device)}\n &:focus-within {\n ${({ theme, disabled }) =>\n !disabled\n ? `border: 1px solid ${theme.colors.brand[700]};\n outline: 1px solid ${theme.colors.brand[700]}`\n : undefined};\n &:hover {\n ${({ theme, checked, disabled, applyAriaDisabled, readOnly, hasError, device }) =>\n handleCheckmark(theme, checked, disabled || applyAriaDisabled, readOnly, hasError, true, device)}\n }\n }\n &:hover {\n background: ${({ theme, applyAriaDisabled, readOnly, disabled }) => {\n if (applyAriaDisabled || readOnly) {\n return theme.colors.neutral['050'];\n }\n return !disabled && !applyAriaDisabled ? theme.colors.brand[200] : undefined;\n }};\n ${({ theme, hasError, disabled }) =>\n !hasError && !disabled ? ` border: 1px solid ${theme.colors.brand[600]}` : undefined};\n }\n`;\n\nconst radioStyles = css`\n &:hover {\n cursor: pointer;\n }\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n`;\n\nexport const StyledInput = styled('input', {\n name: DSRadioName,\n slot: DSRadioSlots.INPUT,\n})`\n ${radioStyles}\n &:disabled, &[aria-disabled='true'] {\n cursor: not-allowed;\n }\n`;\ninterface StyledLabelT {\n disabled?: boolean;\n readOnly?: boolean;\n checked: boolean;\n onClick?: React.MouseEventHandler<HTMLLabelElement>;\n device?: DSControlledRadioT.Devices;\n}\nexport const StyledLabel = styled('label', {\n name: DSRadioName,\n slot: DSRadioSlots.LABEL,\n})<StyledLabelT>`\n color: ${({ theme, disabled, readOnly }) =>\n disabled || readOnly ? theme.colors.neutral[500] : theme.colors.neutral[800]};\n /* Typography metrics delegated to child DSTypography b2 */\n display: inherit;\n width: fit-content;\n\n ${({ disabled }) =>\n disabled\n ? `&:hover {\n cursor: not-allowed;\n }`\n : `&:hover {\n cursor: pointer;\n }`}\n`;\n\nexport const StyledLabelTypography = styled(DSTypography, {\n name: DSRadioName,\n slot: DSRadioSlots.LABEL_TYPOGRAPHY,\n})``;\n\nexport const StyledHiddenP = styled.p`\n display: none;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,KAAK,0BAA0B;AAChD,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB,uBAAuB;AACvD,SAAS,aAAa,oBAAoB;AAEnC,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAAA,IACG,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,WAAW,UAAU;AACvB,WAAO;AAAA,2BACc,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAK9C;AACA,MAAI,WAAW,cAAc;AAC3B,WAAO;AAAA,6BACgB,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhD;AACA,SAAO;AAAA,yBACc,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAM9C,CAAC;AAAA,IACC,CAAC,EAAE,SAAS,MAAO,WAAW,qBAAqB,EAAG;AAAA;AAAA;AAAA;AAAA;AAAA,IAKtD,kBAAkB;AAAA;AAGf,MAAM,cAAc,OAAO,QAAQ;AAAA,EACxC,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAAA,IACG,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,M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AO,UAAU,SAAS,MAC7B,CAAC,YAAY,CAAC,WAAW,uBAAuB,MAAM,OAAO,MAAM,GAAG,CAAC,KAAK,MAAS;AAAA;AAAA;AAI3F,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYb,MAAM,cAAc,OAAO,SAAS;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAAA,IACG,WAAW;AAAA;AAAA;AAAA;AAAA;AAYR,MAAM,cAAc,OAAO,SAAS;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAAA,WACU,CAAC,EAAE,OAAO,UAAU,SAAS,MACpC,YAAY,WAAW,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK5E,CAAC,EAAE,SAAS,MACZ,WACI;AAAA;AAAA,OAGA;AAAA;AAAA,IAEJ;AAAA;AAGG,MAAM,wBAAwB,OAAO,cAAc;AAAA,EACxD,MAAM;AAAA,EACN,MAAM,aAAa;AACrB,CAAC;AAEM,MAAM,gBAAgB,OAAO;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type DSHookFloatingContextT } from '@elliemae/ds-floating-context';
|
|
2
3
|
interface TruncatedTooltipTextProps {
|
|
3
4
|
value?: string;
|
|
4
5
|
placement?: DSHookFloatingContextT.PopperPlacementsT;
|
|
6
|
+
getOwnerProps?: () => object;
|
|
7
|
+
getOwnerPropsArguments?: () => object;
|
|
5
8
|
}
|
|
6
|
-
declare const TruncatedTooltipText: ({ value, placement }: TruncatedTooltipTextProps) =>
|
|
9
|
+
declare const TruncatedTooltipText: ({ value, placement, getOwnerProps, getOwnerPropsArguments, }: TruncatedTooltipTextProps) => React.JSX.Element;
|
|
7
10
|
export { TruncatedTooltipText };
|
|
8
11
|
export default TruncatedTooltipText;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export declare const DSRadioDataTestIds: {
|
|
2
|
-
CONTAINER:
|
|
3
|
-
INPUT:
|
|
4
|
-
|
|
2
|
+
readonly CONTAINER: "ds-radio-container";
|
|
3
|
+
readonly INPUT: "ds-radio";
|
|
4
|
+
readonly LABEL: "ds-radio-label";
|
|
5
|
+
readonly READONLY_HELPER_MSG: "ds-radio-readonly-helper-msg";
|
|
6
|
+
readonly INPUT_WRAPPER: "ds-radio-input-wrapper";
|
|
7
|
+
readonly LABEL_TYPOGRAPHY: "ds-radio-label-typography";
|
|
8
|
+
readonly TRUNCATED_LABEL: "ds-radio-truncated-label";
|
|
9
|
+
readonly TOOLTIP_CONTAINER: "ds-radio-tooltip-container";
|
|
10
|
+
readonly TOOLTIP_TEXT: "ds-radio-tooltip-text";
|
|
5
11
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare const DSRadioName = "DSRadio";
|
|
2
2
|
export declare const DSRadioSlots: {
|
|
3
|
-
CONTAINER:
|
|
4
|
-
INPUT:
|
|
5
|
-
|
|
3
|
+
readonly CONTAINER: "root";
|
|
4
|
+
readonly INPUT: "input";
|
|
5
|
+
readonly INPUT_WRAPPER: "input-wrapper";
|
|
6
|
+
readonly LABEL: "label";
|
|
7
|
+
readonly LABEL_TYPOGRAPHY: "label-typography";
|
|
8
|
+
readonly TRUNCATED_LABEL: "truncated-label";
|
|
9
|
+
readonly TOOLTIP_CONTAINER: "tooltip-container";
|
|
10
|
+
readonly TOOLTIP_TEXT: "tooltip-text";
|
|
6
11
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DSControlledRadioT } from './react-desc-prop-types.js';
|
|
2
2
|
export { type DSControlledRadioT } from './react-desc-prop-types.js';
|
|
3
|
-
export declare const DSControlledRadio: (props: DSControlledRadioT.Props) => import("react
|
|
4
|
-
export declare const PresentationalRadio: (props: DSControlledRadioT.Props) => import("react
|
|
3
|
+
export declare const DSControlledRadio: (props: DSControlledRadioT.Props) => import("react").JSX.Element;
|
|
4
|
+
export declare const PresentationalRadio: (props: DSControlledRadioT.Props) => import("react").JSX.Element;
|
|
5
5
|
export { DSControlledRadioWithSchema } from './ControlledRadio.js';
|
|
6
6
|
export { DSRadioDataTestIds, DSRadioName, DSRadioSlots } from './exported-related/index.js';
|
package/dist/types/styles.d.ts
CHANGED
|
@@ -13,6 +13,6 @@ interface StyledLabelT {
|
|
|
13
13
|
device?: DSControlledRadioT.Devices;
|
|
14
14
|
}
|
|
15
15
|
export declare const StyledLabel: import("styled-components").StyledComponent<"label", import("@elliemae/ds-system").Theme, StyledLabelT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"label">, never>;
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const StyledLabelTypography: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
|
|
17
17
|
export declare const StyledHiddenP: import("styled-components").StyledComponent<"p", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"p">, never>;
|
|
18
18
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-radio",
|
|
3
|
-
"version": "3.70.0-
|
|
3
|
+
"version": "3.70.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Radio",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "https://
|
|
25
|
+
"url": "https://github.com/intcx/PLATFORM-UI.dimsum.git"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"pnpm": ">=9",
|
|
@@ -36,23 +36,24 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-
|
|
40
|
-
"@elliemae/ds-
|
|
41
|
-
"@elliemae/ds-
|
|
39
|
+
"@elliemae/ds-floating-context": "3.70.0-rc.0",
|
|
40
|
+
"@elliemae/ds-system": "3.70.0-rc.0",
|
|
41
|
+
"@elliemae/ds-typography": "3.70.0-rc.0",
|
|
42
|
+
"@elliemae/ds-props-helpers": "3.70.0-rc.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@elliemae/pui-theme": "~2.13.0",
|
|
45
46
|
"jest": "^30.0.0",
|
|
46
|
-
"styled-components": "~5.3.
|
|
47
|
+
"styled-components": "~5.3.11",
|
|
47
48
|
"uid": "^2.0.2",
|
|
48
|
-
"@elliemae/ds-monorepo-devops": "3.70.0-
|
|
49
|
-
"@elliemae/ds-test-utils": "3.70.0-
|
|
49
|
+
"@elliemae/ds-monorepo-devops": "3.70.0-rc.0",
|
|
50
|
+
"@elliemae/ds-test-utils": "3.70.0-rc.0"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"@elliemae/pui-theme": "~2.13.0",
|
|
53
54
|
"react": "^18.3.1",
|
|
54
55
|
"react-dom": "^18.3.1",
|
|
55
|
-
"styled-components": "~5.3.
|
|
56
|
+
"styled-components": "~5.3.11",
|
|
56
57
|
"styled-system": "^5.1.5"
|
|
57
58
|
},
|
|
58
59
|
"publishConfig": {
|
|
@@ -68,4 +69,4 @@
|
|
|
68
69
|
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
69
70
|
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
70
71
|
}
|
|
71
|
-
}
|
|
72
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|