@telus-uds/components-base 3.20.0 → 3.21.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/CHANGELOG.md CHANGED
@@ -1,9 +1,22 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Fri, 10 Oct 2025 15:11:05 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 21 Oct 2025 14:46:26 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 3.21.0
8
+
9
+ Tue, 21 Oct 2025 14:46:26 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `StackView`: add RNMQ support (guillermo.peitzner@telus.com)
14
+
15
+ ### Patches
16
+
17
+ - `Responsive`: fix console warning (guillermo.peitzner@telus.com)
18
+ - `TabsDropdown`: outline unnecessary property removed (35577399+JoshHC@users.noreply.github.com)
19
+
7
20
  ## 3.20.0
8
21
 
9
22
  Fri, 10 Oct 2025 15:11:05 GMT
@@ -68,7 +68,7 @@ ResponsiveWithMediaQueryStyleSheet.propTypes = {
68
68
  /**
69
69
  * To hide children of `Responsive` if the current viewport is larger than `max`
70
70
  */
71
- max: _propTypes.default.oneOf(['sm', 'md', 'lg', 'xl']),
71
+ max: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
72
72
  inheritedStyles: _propTypes.default.arrayOf(_propTypes.default.string),
73
73
  children: _propTypes.default.node.isRequired
74
74
  };
@@ -9,8 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
10
10
  var _Divider = _interopRequireDefault(require("../Divider"));
11
11
  var _utils = require("../utils");
12
- var _ThemeProvider = require("../ThemeProvider");
13
- var _ViewportProvider = require("../ViewportProvider");
12
+ var _useTheme = _interopRequireDefault(require("../ThemeProvider/useTheme"));
14
13
  var _getStackedContent = _interopRequireDefault(require("./getStackedContent"));
15
14
  var _common = require("./common");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
@@ -69,10 +68,15 @@ const StackView = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
69
68
  tokens,
70
69
  tag,
71
70
  accessibilityRole,
71
+ dataSet,
72
72
  ...rest
73
73
  } = _ref;
74
- const viewport = (0, _ViewportProvider.useViewport)();
75
74
  const direction = (0, _utils.useResponsiveProp)(directionProp, 'column');
75
+ const {
76
+ themeOptions: {
77
+ enableMediaQueryStyleSheet
78
+ }
79
+ } = (0, _useTheme.default)();
76
80
  const selectedProps = selectProps({
77
81
  accessibilityRole,
78
82
  ...(0, _utils.getA11yPropsFromHtmlTag)(tag, accessibilityRole),
@@ -83,17 +87,58 @@ const StackView = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
83
87
  divider,
84
88
  space
85
89
  });
86
- const themeTokens = (0, _ThemeProvider.useThemeTokens)('StackView', tokens, variant, {
87
- viewport
88
- });
89
- const flexStyles = (0, _common.selectFlexStyles)(themeTokens);
90
- const size = {
91
- width: themeTokens.width
92
- };
90
+ const allTokens = (0, _utils.useAllViewportTokens)('StackView', tokens, variant);
91
+ let stackViewStyles;
92
+ let dataSetValue = dataSet;
93
+ if (enableMediaQueryStyleSheet) {
94
+ const stylesByViewport = {
95
+ xs: {
96
+ ...(0, _common.selectFlexStyles)(allTokens.xs),
97
+ width: allTokens.xs.width
98
+ },
99
+ sm: {
100
+ ...(0, _common.selectFlexStyles)(allTokens.sm),
101
+ width: allTokens.sm.width
102
+ },
103
+ md: {
104
+ ...(0, _common.selectFlexStyles)(allTokens.md),
105
+ width: allTokens.md.width
106
+ },
107
+ lg: {
108
+ ...(0, _common.selectFlexStyles)(allTokens.lg),
109
+ width: allTokens.lg.width
110
+ },
111
+ xl: {
112
+ ...(0, _common.selectFlexStyles)(allTokens.xl),
113
+ width: allTokens.xl.width
114
+ }
115
+ };
116
+ const mediaQueryStyles = (0, _utils.createMediaQueryStyles)(stylesByViewport);
117
+ const {
118
+ ids,
119
+ styles
120
+ } = _utils.StyleSheet.create({
121
+ stackView: {
122
+ ...mediaQueryStyles
123
+ }
124
+ });
125
+ stackViewStyles = [_common.staticStyles[direction], styles.stackView];
126
+ dataSetValue = {
127
+ media: ids.stackView,
128
+ ...dataSet
129
+ };
130
+ } else {
131
+ const flexStyles = (0, _common.selectFlexStyles)(allTokens.current);
132
+ const size = {
133
+ width: allTokens.current.width
134
+ };
135
+ stackViewStyles = [flexStyles, _common.staticStyles[direction], size];
136
+ }
93
137
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
94
138
  ref: ref,
95
139
  ...selectedProps,
96
- style: [flexStyles, _common.staticStyles[direction], size],
140
+ style: stackViewStyles,
141
+ dataSet: dataSetValue,
97
142
  children: content
98
143
  });
99
144
  });
@@ -128,6 +173,11 @@ StackView.propTypes = {
128
173
  * A StackView may take any children, but will have no effect if it is only passed one child or is passed children
129
174
  * wrapped in a component. If necessary, children may be wrapped in one React Fragment.
130
175
  */
131
- children: _propTypes.default.node
176
+ children: _propTypes.default.node,
177
+ /**
178
+ * Data attributes to be applied to the element. When media query stylesheet is enabled,
179
+ * this will include media query IDs for responsive styling.
180
+ */
181
+ dataSet: _propTypes.default.object
132
182
  };
133
183
  var _default = exports.default = StackView;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
9
10
  var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
10
11
  var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
11
12
  var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
@@ -233,20 +234,18 @@ const styles = _StyleSheet.default.create({
233
234
  position: 'relative',
234
235
  width: '100%'
235
236
  },
236
- pressable: {
237
+ pressable: _Platform.default.OS === 'web' ? {
237
238
  outlineWidth: 0,
238
239
  outlineStyle: 'none',
239
240
  outlineColor: 'transparent'
240
- },
241
+ } : {},
241
242
  buttonContent: {
242
243
  display: 'flex',
243
244
  flexDirection: 'row',
244
245
  alignItems: 'center',
245
246
  justifyContent: 'space-between',
246
247
  width: '100%',
247
- minHeight: 44,
248
- outline: 'none',
249
- boxSizing: 'border-box'
248
+ minHeight: 44
250
249
  }
251
250
  });
252
251
  var _default = exports.default = TabsDropdown;
@@ -10,8 +10,15 @@ Object.defineProperty(exports, "createMediaQueryStyles", {
10
10
  return _createMediaQueryStyles.default;
11
11
  }
12
12
  });
13
+ Object.defineProperty(exports, "useAllViewportTokens", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _useAllViewportTokens.default;
17
+ }
18
+ });
13
19
  var _createStylesheet = _interopRequireDefault(require("./create-stylesheet"));
14
20
  var _createMediaQueryStyles = _interopRequireDefault(require("./utils/create-media-query-styles"));
21
+ var _useAllViewportTokens = _interopRequireDefault(require("./utils/use-all-viewport-tokens"));
15
22
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
23
  const StyleSheet = exports.StyleSheet = {
17
24
  create: _createStylesheet.default
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ThemeProvider = require("../../../ThemeProvider");
8
+ var _ViewportProvider = require("../../../ViewportProvider");
9
+ /**
10
+ * Hook to get theme tokens for all viewports at once.
11
+ * This is useful for components that need to support React Native Media Queries (RNMQ).
12
+ *
13
+ * All hooks are called unconditionally to comply with React's Rules of Hooks.
14
+ *
15
+ * @param {string} componentName - The name of the component to get tokens for
16
+ * @param {object|function} tokens - Custom tokens or token function
17
+ * @param {object} variant - Variant configuration
18
+ * @returns {object} Object with tokens for each viewport (xs, sm, md, lg, xl, current)
19
+ *
20
+ * @example
21
+ * const allTokens = useAllViewportTokens('StackView', tokens, variant)
22
+ * // Returns: { xs: {...}, sm: {...}, md: {...}, lg: {...}, xl: {...}, current: {...} }
23
+ */
24
+ const useAllViewportTokens = (componentName, tokens, variant) => {
25
+ const viewport = (0, _ViewportProvider.useViewport)();
26
+ const xs = (0, _ThemeProvider.useThemeTokens)(componentName, tokens, variant, {
27
+ viewport: 'xs'
28
+ });
29
+ const sm = (0, _ThemeProvider.useThemeTokens)(componentName, tokens, variant, {
30
+ viewport: 'sm'
31
+ });
32
+ const md = (0, _ThemeProvider.useThemeTokens)(componentName, tokens, variant, {
33
+ viewport: 'md'
34
+ });
35
+ const lg = (0, _ThemeProvider.useThemeTokens)(componentName, tokens, variant, {
36
+ viewport: 'lg'
37
+ });
38
+ const xl = (0, _ThemeProvider.useThemeTokens)(componentName, tokens, variant, {
39
+ viewport: 'xl'
40
+ });
41
+ const current = (0, _ThemeProvider.useThemeTokens)(componentName, tokens, variant, {
42
+ viewport
43
+ });
44
+ return {
45
+ xs,
46
+ sm,
47
+ md,
48
+ lg,
49
+ xl,
50
+ current
51
+ };
52
+ };
53
+ var _default = exports.default = useAllViewportTokens;
@@ -61,7 +61,7 @@ ResponsiveWithMediaQueryStyleSheet.propTypes = {
61
61
  /**
62
62
  * To hide children of `Responsive` if the current viewport is larger than `max`
63
63
  */
64
- max: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
64
+ max: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
65
65
  inheritedStyles: PropTypes.arrayOf(PropTypes.string),
66
66
  children: PropTypes.node.isRequired
67
67
  };
@@ -2,9 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import View from "react-native-web/dist/exports/View";
4
4
  import Divider from '../Divider';
5
- import { a11yProps, getA11yPropsFromHtmlTag, getTokensPropType, layoutTags, responsiveProps, selectSystemProps, spacingProps, useResponsiveProp, variantProp, viewProps } from '../utils';
6
- import { useThemeTokens } from '../ThemeProvider';
7
- import { useViewport } from '../ViewportProvider';
5
+ import { a11yProps, getA11yPropsFromHtmlTag, getTokensPropType, layoutTags, responsiveProps, selectSystemProps, spacingProps, useResponsiveProp, variantProp, viewProps, StyleSheet as StyleSheetUtils, createMediaQueryStyles, useAllViewportTokens } from '../utils';
6
+ import useTheme from '../ThemeProvider/useTheme';
8
7
  import getStackedContent from './getStackedContent';
9
8
  import { staticStyles, selectFlexStyles } from './common';
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -62,10 +61,15 @@ const StackView = /*#__PURE__*/React.forwardRef((_ref, ref) => {
62
61
  tokens,
63
62
  tag,
64
63
  accessibilityRole,
64
+ dataSet,
65
65
  ...rest
66
66
  } = _ref;
67
- const viewport = useViewport();
68
67
  const direction = useResponsiveProp(directionProp, 'column');
68
+ const {
69
+ themeOptions: {
70
+ enableMediaQueryStyleSheet
71
+ }
72
+ } = useTheme();
69
73
  const selectedProps = selectProps({
70
74
  accessibilityRole,
71
75
  ...getA11yPropsFromHtmlTag(tag, accessibilityRole),
@@ -76,17 +80,58 @@ const StackView = /*#__PURE__*/React.forwardRef((_ref, ref) => {
76
80
  divider,
77
81
  space
78
82
  });
79
- const themeTokens = useThemeTokens('StackView', tokens, variant, {
80
- viewport
81
- });
82
- const flexStyles = selectFlexStyles(themeTokens);
83
- const size = {
84
- width: themeTokens.width
85
- };
83
+ const allTokens = useAllViewportTokens('StackView', tokens, variant);
84
+ let stackViewStyles;
85
+ let dataSetValue = dataSet;
86
+ if (enableMediaQueryStyleSheet) {
87
+ const stylesByViewport = {
88
+ xs: {
89
+ ...selectFlexStyles(allTokens.xs),
90
+ width: allTokens.xs.width
91
+ },
92
+ sm: {
93
+ ...selectFlexStyles(allTokens.sm),
94
+ width: allTokens.sm.width
95
+ },
96
+ md: {
97
+ ...selectFlexStyles(allTokens.md),
98
+ width: allTokens.md.width
99
+ },
100
+ lg: {
101
+ ...selectFlexStyles(allTokens.lg),
102
+ width: allTokens.lg.width
103
+ },
104
+ xl: {
105
+ ...selectFlexStyles(allTokens.xl),
106
+ width: allTokens.xl.width
107
+ }
108
+ };
109
+ const mediaQueryStyles = createMediaQueryStyles(stylesByViewport);
110
+ const {
111
+ ids,
112
+ styles
113
+ } = StyleSheetUtils.create({
114
+ stackView: {
115
+ ...mediaQueryStyles
116
+ }
117
+ });
118
+ stackViewStyles = [staticStyles[direction], styles.stackView];
119
+ dataSetValue = {
120
+ media: ids.stackView,
121
+ ...dataSet
122
+ };
123
+ } else {
124
+ const flexStyles = selectFlexStyles(allTokens.current);
125
+ const size = {
126
+ width: allTokens.current.width
127
+ };
128
+ stackViewStyles = [flexStyles, staticStyles[direction], size];
129
+ }
86
130
  return /*#__PURE__*/_jsx(View, {
87
131
  ref: ref,
88
132
  ...selectedProps,
89
- style: [flexStyles, staticStyles[direction], size],
133
+ style: stackViewStyles,
134
+ dataSet: dataSetValue,
90
135
  children: content
91
136
  });
92
137
  });
@@ -121,6 +166,11 @@ StackView.propTypes = {
121
166
  * A StackView may take any children, but will have no effect if it is only passed one child or is passed children
122
167
  * wrapped in a component. If necessary, children may be wrapped in one React Fragment.
123
168
  */
124
- children: PropTypes.node
169
+ children: PropTypes.node,
170
+ /**
171
+ * Data attributes to be applied to the element. When media query stylesheet is enabled,
172
+ * this will include media query IDs for responsive styling.
173
+ */
174
+ dataSet: PropTypes.object
125
175
  };
126
176
  export default StackView;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import Platform from "react-native-web/dist/exports/Platform";
3
4
  import Pressable from "react-native-web/dist/exports/Pressable";
4
5
  import StyleSheet from "react-native-web/dist/exports/StyleSheet";
5
6
  import Text from "react-native-web/dist/exports/Text";
@@ -226,20 +227,18 @@ const styles = StyleSheet.create({
226
227
  position: 'relative',
227
228
  width: '100%'
228
229
  },
229
- pressable: {
230
+ pressable: Platform.OS === 'web' ? {
230
231
  outlineWidth: 0,
231
232
  outlineStyle: 'none',
232
233
  outlineColor: 'transparent'
233
- },
234
+ } : {},
234
235
  buttonContent: {
235
236
  display: 'flex',
236
237
  flexDirection: 'row',
237
238
  alignItems: 'center',
238
239
  justifyContent: 'space-between',
239
240
  width: '100%',
240
- minHeight: 44,
241
- outline: 'none',
242
- boxSizing: 'border-box'
241
+ minHeight: 44
243
242
  }
244
243
  });
245
244
  export default TabsDropdown;
@@ -1,6 +1,7 @@
1
1
  import createStyleSheet from './create-stylesheet';
2
2
  import createMediaQueryStyles from './utils/create-media-query-styles';
3
+ import useAllViewportTokens from './utils/use-all-viewport-tokens';
3
4
  const StyleSheet = {
4
5
  create: createStyleSheet
5
6
  };
6
- export { StyleSheet, createMediaQueryStyles };
7
+ export { StyleSheet, createMediaQueryStyles, useAllViewportTokens };
@@ -0,0 +1,48 @@
1
+ import { useThemeTokens } from '../../../ThemeProvider';
2
+ import { useViewport } from '../../../ViewportProvider';
3
+
4
+ /**
5
+ * Hook to get theme tokens for all viewports at once.
6
+ * This is useful for components that need to support React Native Media Queries (RNMQ).
7
+ *
8
+ * All hooks are called unconditionally to comply with React's Rules of Hooks.
9
+ *
10
+ * @param {string} componentName - The name of the component to get tokens for
11
+ * @param {object|function} tokens - Custom tokens or token function
12
+ * @param {object} variant - Variant configuration
13
+ * @returns {object} Object with tokens for each viewport (xs, sm, md, lg, xl, current)
14
+ *
15
+ * @example
16
+ * const allTokens = useAllViewportTokens('StackView', tokens, variant)
17
+ * // Returns: { xs: {...}, sm: {...}, md: {...}, lg: {...}, xl: {...}, current: {...} }
18
+ */
19
+ const useAllViewportTokens = (componentName, tokens, variant) => {
20
+ const viewport = useViewport();
21
+ const xs = useThemeTokens(componentName, tokens, variant, {
22
+ viewport: 'xs'
23
+ });
24
+ const sm = useThemeTokens(componentName, tokens, variant, {
25
+ viewport: 'sm'
26
+ });
27
+ const md = useThemeTokens(componentName, tokens, variant, {
28
+ viewport: 'md'
29
+ });
30
+ const lg = useThemeTokens(componentName, tokens, variant, {
31
+ viewport: 'lg'
32
+ });
33
+ const xl = useThemeTokens(componentName, tokens, variant, {
34
+ viewport: 'xl'
35
+ });
36
+ const current = useThemeTokens(componentName, tokens, variant, {
37
+ viewport
38
+ });
39
+ return {
40
+ xs,
41
+ sm,
42
+ md,
43
+ lg,
44
+ xl,
45
+ current
46
+ };
47
+ };
48
+ export default useAllViewportTokens;
package/lib/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "@testing-library/react": "^13.3.0",
35
35
  "@testing-library/react-hooks": "~7.0.1",
36
36
  "@testing-library/react-native": "11.0.0",
37
- "react-test-renderer": "~18.0.0",
37
+ "react-test-renderer": "^18.0.0",
38
38
  "webpack": "5.x"
39
39
  },
40
40
  "exports": {
@@ -59,8 +59,8 @@
59
59
  "react": ">=18.2.0 <19.0.0",
60
60
  "react-dom": ">=18.2.0 <19.0.0",
61
61
  "react-native": "^0.74.5",
62
- "react-native-web": "^0.19.10",
63
- "react-native-svg": "15.7.1"
62
+ "react-native-svg": "15.7.1",
63
+ "react-native-web": "^0.19.10"
64
64
  },
65
65
  "react-native": "src/index.js",
66
66
  "repository": {
@@ -84,6 +84,6 @@
84
84
  "standard-engine": {
85
85
  "skip": true
86
86
  },
87
- "version": "3.20.0",
87
+ "version": "3.21.0",
88
88
  "types": "types/index.d.ts"
89
89
  }
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "@testing-library/react": "^13.3.0",
35
35
  "@testing-library/react-hooks": "~7.0.1",
36
36
  "@testing-library/react-native": "11.0.0",
37
- "react-test-renderer": "~18.0.0",
37
+ "react-test-renderer": "^18.0.0",
38
38
  "webpack": "5.x"
39
39
  },
40
40
  "exports": {
@@ -59,8 +59,8 @@
59
59
  "react": ">=18.2.0 <19.0.0",
60
60
  "react-dom": ">=18.2.0 <19.0.0",
61
61
  "react-native": "^0.74.5",
62
- "react-native-web": "^0.19.10",
63
- "react-native-svg": "15.7.1"
62
+ "react-native-svg": "15.7.1",
63
+ "react-native-web": "^0.19.10"
64
64
  },
65
65
  "react-native": "src/index.js",
66
66
  "repository": {
@@ -84,6 +84,6 @@
84
84
  "standard-engine": {
85
85
  "skip": true
86
86
  },
87
- "version": "3.20.0",
87
+ "version": "3.21.0",
88
88
  "types": "types/index.d.ts"
89
89
  }
@@ -59,7 +59,7 @@ ResponsiveWithMediaQueryStyleSheet.propTypes = {
59
59
  /**
60
60
  * To hide children of `Responsive` if the current viewport is larger than `max`
61
61
  */
62
- max: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
62
+ max: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
63
63
  inheritedStyles: PropTypes.arrayOf(PropTypes.string),
64
64
  children: PropTypes.node.isRequired
65
65
  }
@@ -13,10 +13,12 @@ import {
13
13
  spacingProps,
14
14
  useResponsiveProp,
15
15
  variantProp,
16
- viewProps
16
+ viewProps,
17
+ StyleSheet as StyleSheetUtils,
18
+ createMediaQueryStyles,
19
+ useAllViewportTokens
17
20
  } from '../utils'
18
- import { useThemeTokens } from '../ThemeProvider'
19
- import { useViewport } from '../ViewportProvider'
21
+ import useTheme from '../ThemeProvider/useTheme'
20
22
  import getStackedContent from './getStackedContent'
21
23
  import { staticStyles, selectFlexStyles } from './common'
22
24
 
@@ -75,24 +77,70 @@ const StackView = React.forwardRef(
75
77
  tokens,
76
78
  tag,
77
79
  accessibilityRole,
80
+ dataSet,
78
81
  ...rest
79
82
  },
80
83
  ref
81
84
  ) => {
82
- const viewport = useViewport()
83
85
  const direction = useResponsiveProp(directionProp, 'column')
86
+ const {
87
+ themeOptions: { enableMediaQueryStyleSheet }
88
+ } = useTheme()
89
+
84
90
  const selectedProps = selectProps({
85
91
  accessibilityRole,
86
92
  ...getA11yPropsFromHtmlTag(tag, accessibilityRole),
87
93
  ...rest
88
94
  })
89
95
  const content = getStackedContent(children, { direction, divider, space })
90
- const themeTokens = useThemeTokens('StackView', tokens, variant, { viewport })
91
- const flexStyles = selectFlexStyles(themeTokens)
92
- const size = { width: themeTokens.width }
96
+
97
+ const allTokens = useAllViewportTokens('StackView', tokens, variant)
98
+
99
+ let stackViewStyles
100
+ let dataSetValue = dataSet
101
+
102
+ if (enableMediaQueryStyleSheet) {
103
+ const stylesByViewport = {
104
+ xs: {
105
+ ...selectFlexStyles(allTokens.xs),
106
+ width: allTokens.xs.width
107
+ },
108
+ sm: {
109
+ ...selectFlexStyles(allTokens.sm),
110
+ width: allTokens.sm.width
111
+ },
112
+ md: {
113
+ ...selectFlexStyles(allTokens.md),
114
+ width: allTokens.md.width
115
+ },
116
+ lg: {
117
+ ...selectFlexStyles(allTokens.lg),
118
+ width: allTokens.lg.width
119
+ },
120
+ xl: {
121
+ ...selectFlexStyles(allTokens.xl),
122
+ width: allTokens.xl.width
123
+ }
124
+ }
125
+
126
+ const mediaQueryStyles = createMediaQueryStyles(stylesByViewport)
127
+
128
+ const { ids, styles } = StyleSheetUtils.create({
129
+ stackView: {
130
+ ...mediaQueryStyles
131
+ }
132
+ })
133
+
134
+ stackViewStyles = [staticStyles[direction], styles.stackView]
135
+ dataSetValue = { media: ids.stackView, ...dataSet }
136
+ } else {
137
+ const flexStyles = selectFlexStyles(allTokens.current)
138
+ const size = { width: allTokens.current.width }
139
+ stackViewStyles = [flexStyles, staticStyles[direction], size]
140
+ }
93
141
 
94
142
  return (
95
- <View ref={ref} {...selectedProps} style={[flexStyles, staticStyles[direction], size]}>
143
+ <View ref={ref} {...selectedProps} style={stackViewStyles} dataSet={dataSetValue}>
96
144
  {content}
97
145
  </View>
98
146
  )
@@ -132,7 +180,12 @@ StackView.propTypes = {
132
180
  * A StackView may take any children, but will have no effect if it is only passed one child or is passed children
133
181
  * wrapped in a component. If necessary, children may be wrapped in one React Fragment.
134
182
  */
135
- children: PropTypes.node
183
+ children: PropTypes.node,
184
+ /**
185
+ * Data attributes to be applied to the element. When media query stylesheet is enabled,
186
+ * this will include media query IDs for responsive styling.
187
+ */
188
+ dataSet: PropTypes.object
136
189
  }
137
190
 
138
191
  export default StackView
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { Pressable, StyleSheet, Text, View } from 'react-native'
3
+ import { Platform, Pressable, StyleSheet, Text, View } from 'react-native'
4
4
  import { useThemeTokensCallback, applyTextStyles, useTheme } from '../ThemeProvider'
5
5
  import {
6
6
  a11yProps,
@@ -245,20 +245,21 @@ const styles = StyleSheet.create({
245
245
  position: 'relative',
246
246
  width: '100%'
247
247
  },
248
- pressable: {
249
- outlineWidth: 0,
250
- outlineStyle: 'none',
251
- outlineColor: 'transparent'
252
- },
248
+ pressable:
249
+ Platform.OS === 'web'
250
+ ? {
251
+ outlineWidth: 0,
252
+ outlineStyle: 'none',
253
+ outlineColor: 'transparent'
254
+ }
255
+ : {},
253
256
  buttonContent: {
254
257
  display: 'flex',
255
258
  flexDirection: 'row',
256
259
  alignItems: 'center',
257
260
  justifyContent: 'space-between',
258
261
  width: '100%',
259
- minHeight: 44,
260
- outline: 'none',
261
- boxSizing: 'border-box'
262
+ minHeight: 44
262
263
  }
263
264
  })
264
265
 
@@ -1,8 +1,9 @@
1
1
  import createStyleSheet from './create-stylesheet'
2
2
  import createMediaQueryStyles from './utils/create-media-query-styles'
3
+ import useAllViewportTokens from './utils/use-all-viewport-tokens'
3
4
 
4
5
  const StyleSheet = {
5
6
  create: createStyleSheet
6
7
  }
7
8
 
8
- export { StyleSheet, createMediaQueryStyles }
9
+ export { StyleSheet, createMediaQueryStyles, useAllViewportTokens }
@@ -0,0 +1,32 @@
1
+ import { useThemeTokens } from '../../../ThemeProvider'
2
+ import { useViewport } from '../../../ViewportProvider'
3
+
4
+ /**
5
+ * Hook to get theme tokens for all viewports at once.
6
+ * This is useful for components that need to support React Native Media Queries (RNMQ).
7
+ *
8
+ * All hooks are called unconditionally to comply with React's Rules of Hooks.
9
+ *
10
+ * @param {string} componentName - The name of the component to get tokens for
11
+ * @param {object|function} tokens - Custom tokens or token function
12
+ * @param {object} variant - Variant configuration
13
+ * @returns {object} Object with tokens for each viewport (xs, sm, md, lg, xl, current)
14
+ *
15
+ * @example
16
+ * const allTokens = useAllViewportTokens('StackView', tokens, variant)
17
+ * // Returns: { xs: {...}, sm: {...}, md: {...}, lg: {...}, xl: {...}, current: {...} }
18
+ */
19
+ const useAllViewportTokens = (componentName, tokens, variant) => {
20
+ const viewport = useViewport()
21
+
22
+ const xs = useThemeTokens(componentName, tokens, variant, { viewport: 'xs' })
23
+ const sm = useThemeTokens(componentName, tokens, variant, { viewport: 'sm' })
24
+ const md = useThemeTokens(componentName, tokens, variant, { viewport: 'md' })
25
+ const lg = useThemeTokens(componentName, tokens, variant, { viewport: 'lg' })
26
+ const xl = useThemeTokens(componentName, tokens, variant, { viewport: 'xl' })
27
+ const current = useThemeTokens(componentName, tokens, variant, { viewport })
28
+
29
+ return { xs, sm, md, lg, xl, current }
30
+ }
31
+
32
+ export default useAllViewportTokens