@react-spectrum/style-macro-s1 3.0.0-alpha.3 → 3.0.0-alpha.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/style-macro-s1",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.5",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "source": "src/index.ts",
@@ -18,5 +18,5 @@
18
18
  "publishConfig": {
19
19
  "access": "public"
20
20
  },
21
- "gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
21
+ "gitHead": "0bda51183baa23306342af32a82012ea0fe0f2dc"
22
22
  }
@@ -252,7 +252,14 @@ const color = {
252
252
  LinkText: 'LinkText'
253
253
  };
254
254
 
255
- export function baseColor(base: keyof typeof color) {
255
+ interface ColorStates {
256
+ default: keyof typeof color,
257
+ isHovered: keyof typeof color,
258
+ isFocusVisible: keyof typeof color,
259
+ isPressed: keyof typeof color
260
+ }
261
+
262
+ export function baseColor(base: keyof typeof color): ColorStates {
256
263
  let keys = Object.keys(color) as (keyof typeof color)[];
257
264
  let index = keys.indexOf(base);
258
265
  if (index === -1) {
@@ -696,7 +703,8 @@ export const style = createTheme({
696
703
  hyphens: ['none', 'manual', 'auto'] as const,
697
704
  whiteSpace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] as const,
698
705
  textWrap: ['wrap', 'nowrap', 'balance', 'pretty'] as const,
699
- wordBreak: ['normal', 'break-all', 'keep-all'] as const, // also overflowWrap??
706
+ wordBreak: ['normal', 'break-all', 'keep-all'] as const,
707
+ overflowWrap: ['normal', 'anywhere', 'break-word'] as const,
700
708
  boxDecorationBreak: ['slice', 'clone'] as const,
701
709
 
702
710
  // effects
@@ -449,7 +449,7 @@ function printRuleChildren(rule: Rule, indent = '') {
449
449
  return res;
450
450
  }
451
451
 
452
- export function raw(this: MacroContext | void, css: string) {
452
+ export function raw(this: MacroContext | void, css: string): string {
453
453
  let className = generateArbitraryValueSelector(css, true);
454
454
  css = `.${className} {
455
455
  ${css}
@@ -463,7 +463,7 @@ export function raw(this: MacroContext | void, css: string) {
463
463
  return className;
464
464
  }
465
465
 
466
- export function keyframes(this: MacroContext | void, css: string) {
466
+ export function keyframes(this: MacroContext | void, css: string): string {
467
467
  let name = generateArbitraryValueSelector(css, true);
468
468
  css = `@keyframes ${name} {
469
469
  ${css}