@planningcenter/tapestry 4.15.0-rc.1 → 4.15.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.
Files changed (121) hide show
  1. package/dist/components/DataTable/ActiveFilterInstance.d.ts +6 -0
  2. package/dist/components/DataTable/ActiveFilterInstance.d.ts.map +1 -1
  3. package/dist/components/DataTable/ActiveFilterInstance.js +13 -0
  4. package/dist/components/DataTable/ActiveFilterInstance.js.map +1 -1
  5. package/dist/components/DataTable/CollectionEditorsLazy.d.ts +1 -1
  6. package/dist/components/DataTable/CollectionEditorsLazy.d.ts.map +1 -1
  7. package/dist/components/DataTable/CollectionEditorsLazy.js +2 -2
  8. package/dist/components/DataTable/CollectionEditorsLazy.js.map +1 -1
  9. package/dist/components/DataTable/CollectionEditorsShared.d.ts +4 -8
  10. package/dist/components/DataTable/CollectionEditorsShared.d.ts.map +1 -1
  11. package/dist/components/DataTable/CollectionEditorsShared.js +2 -2
  12. package/dist/components/DataTable/CollectionEditorsShared.js.map +1 -1
  13. package/dist/components/DataTable/CollectionEditorsStatic.d.ts +4 -5
  14. package/dist/components/DataTable/CollectionEditorsStatic.d.ts.map +1 -1
  15. package/dist/components/DataTable/CollectionEditorsStatic.js +9 -9
  16. package/dist/components/DataTable/CollectionEditorsStatic.js.map +1 -1
  17. package/dist/components/DataTable/DataTable.d.ts +27 -5
  18. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  19. package/dist/components/DataTable/DataTable.js +13 -2
  20. package/dist/components/DataTable/DataTable.js.map +1 -1
  21. package/dist/components/DataTable/DataTableRow.d.ts +2 -0
  22. package/dist/components/DataTable/DataTableRow.d.ts.map +1 -1
  23. package/dist/components/DataTable/DataTableRow.js.map +1 -1
  24. package/dist/components/DataTable/RowActions.d.ts +7 -3
  25. package/dist/components/DataTable/RowActions.d.ts.map +1 -1
  26. package/dist/components/DataTable/RowActions.js +7 -2
  27. package/dist/components/DataTable/RowActions.js.map +1 -1
  28. package/dist/components/DataTable/collectionFilter.js +1 -1
  29. package/dist/components/DataTable/collectionFilter.js.map +1 -1
  30. package/dist/components/DataTable/dateFilter.js +5 -5
  31. package/dist/components/DataTable/dateFilter.js.map +1 -1
  32. package/dist/components/DataTable/dayFilter.js +4 -3
  33. package/dist/components/DataTable/dayFilter.js.map +1 -1
  34. package/dist/components/DataTable/index.d.ts +1 -1
  35. package/dist/components/DataTable/index.d.ts.map +1 -1
  36. package/dist/components/DataTable/numberFilter.js +3 -2
  37. package/dist/components/DataTable/numberFilter.js.map +1 -1
  38. package/dist/components/DataTable/scopedFilter.js +5 -1
  39. package/dist/components/DataTable/scopedFilter.js.map +1 -1
  40. package/dist/components/DataTable/textFilter.js +1 -1
  41. package/dist/components/DataTable/textFilter.js.map +1 -1
  42. package/dist/components/button/ActionsDropdownIconButton.js +2 -2
  43. package/dist/components/button/ActionsDropdownIconButton.js.map +1 -1
  44. package/dist/components/button/BaseButton.js +4 -4
  45. package/dist/components/button/BaseButton.js.map +1 -1
  46. package/dist/components/button/Button.js +2 -2
  47. package/dist/components/button/Button.js.map +1 -1
  48. package/dist/components/button/DropdownButton.js +3 -3
  49. package/dist/components/button/DropdownButton.js.map +1 -1
  50. package/dist/components/button/DropdownIconButton.js +2 -2
  51. package/dist/components/button/DropdownIconButton.js.map +1 -1
  52. package/dist/components/button/IconButton.js +4 -4
  53. package/dist/components/button/IconButton.js.map +1 -1
  54. package/dist/components/button/LoadingButton.js +2 -2
  55. package/dist/components/button/LoadingButton.js.map +1 -1
  56. package/dist/components/button/PageHeaderActionsDropdownButton.js +3 -3
  57. package/dist/components/button/PageHeaderActionsDropdownButton.js.map +1 -1
  58. package/dist/components/combo-box/ComboBox.js +31 -31
  59. package/dist/components/combo-box/ComboBox.js.map +1 -1
  60. package/dist/components/date-picker/DatePicker.js +42 -42
  61. package/dist/components/date-picker/DatePicker.js.map +1 -1
  62. package/dist/components/dropdown/Dropdown.js +13 -13
  63. package/dist/components/dropdown/Dropdown.js.map +1 -1
  64. package/dist/components/field/Field.js +5 -5
  65. package/dist/components/field/Field.js.map +1 -1
  66. package/dist/components/internal/LoadingSpinner.js +2 -2
  67. package/dist/components/internal/LoadingSpinner.js.map +1 -1
  68. package/dist/components/internal/tooltip/Tooltip.js +8 -8
  69. package/dist/components/internal/tooltip/Tooltip.js.map +1 -1
  70. package/dist/components/link/BaseLink.js +3 -3
  71. package/dist/components/link/BaseLink.js.map +1 -1
  72. package/dist/components/link/IconLink.js +4 -4
  73. package/dist/components/link/IconLink.js.map +1 -1
  74. package/dist/components/link/Link.js +2 -2
  75. package/dist/components/link/Link.js.map +1 -1
  76. package/dist/components/number-stepper/NumberStepper.js +11 -11
  77. package/dist/components/number-stepper/NumberStepper.js.map +1 -1
  78. package/dist/components/page-header/PageHeader.js +10 -10
  79. package/dist/components/page-header/PageHeader.js.map +1 -1
  80. package/dist/components/search-input/SearchInput.js +6 -6
  81. package/dist/components/search-input/SearchInput.js.map +1 -1
  82. package/dist/components/select/Select.js +6 -6
  83. package/dist/components/select/Select.js.map +1 -1
  84. package/dist/components/select/SelectNative.js +6 -6
  85. package/dist/components/select/SelectNative.js.map +1 -1
  86. package/dist/components/select/SelectOptions.js +9 -9
  87. package/dist/components/select/SelectOptions.js.map +1 -1
  88. package/dist/components/select/SelectPopover.js +14 -14
  89. package/dist/components/select/SelectPopover.js.map +1 -1
  90. package/dist/components/sidenav/Sidenav.js +6 -6
  91. package/dist/components/sidenav/Sidenav.js.map +1 -1
  92. package/dist/components/sidenav/SidenavItem.js +2 -2
  93. package/dist/components/sidenav/SidenavItem.js.map +1 -1
  94. package/dist/components/sidenav/SidenavSection.js +7 -7
  95. package/dist/components/sidenav/SidenavSection.js.map +1 -1
  96. package/dist/components/sidenav/private/SidenavResponsiveHeader.js +6 -6
  97. package/dist/components/sidenav/private/SidenavResponsiveHeader.js.map +1 -1
  98. package/dist/components/sidenav/private/withSlotChildrenAsActions.js +7 -7
  99. package/dist/components/sidenav/private/withSlotChildrenAsActions.js.map +1 -1
  100. package/dist/components/time-field/TimeField.js +8 -8
  101. package/dist/components/time-field/TimeField.js.map +1 -1
  102. package/dist/packages/tapestry-render/dist/buildComponent-DzY2PDMT.js +4 -4
  103. package/dist/packages/tapestry-render/dist/buildComponent-DzY2PDMT.js.map +1 -1
  104. package/dist/reactRender.css +180 -141
  105. package/dist/reactRender.css.map +1 -1
  106. package/dist/reactRenderLegacy.css +180 -141
  107. package/dist/reactRenderLegacy.css.map +1 -1
  108. package/dist/tapestryMount.css +180 -141
  109. package/dist/tapestryMount.css.map +1 -1
  110. package/dist/tapestryMountLegacy.css +180 -141
  111. package/dist/tapestryMountLegacy.css.map +1 -1
  112. package/dist/unstable.css +45 -6
  113. package/dist/unstable.css.map +1 -1
  114. package/dist/utilities/Icon.js +2 -2
  115. package/dist/utilities/Icon.js.map +1 -1
  116. package/dist/utilities/buttonLinkShared.js +2 -2
  117. package/dist/utilities/buttonLinkShared.js.map +1 -1
  118. package/dist/utilities/locale.js +34 -5
  119. package/dist/utilities/locale.js.map +1 -1
  120. package/docs/components/DataTable.md +23 -5
  121. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import general from '@planningcenter/icons/sprites/general.svg';
2
2
  import { Symbol } from '@planningcenter/icons/symbol';
3
- import React from 'react';
3
+ import React__default from 'react';
4
4
 
5
5
  // Registry of valid sprite sheet collections
6
6
  // We will add the other collections here when we / if we make this more publicly available
@@ -16,7 +16,7 @@ function Icon({ symbol: s, className, ...props }) {
16
16
  throw new Error(`Unknown icon collection: ${collection}. Available collections: ${Object.keys(validCollections).join(", ")}`);
17
17
  }
18
18
  const spriteSheet = validCollections[collection];
19
- return (React.createElement(Symbol, { symbol: `${spriteSheet}#${symbol}`, className: className, ...props }));
19
+ return (React__default.createElement(Symbol, { symbol: `${spriteSheet}#${symbol}`, className: className, ...props }));
20
20
  }
21
21
 
22
22
  export { Icon as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sources":["../../src/utilities/Icon.tsx"],"sourcesContent":["import general from \"@planningcenter/icons/sprites/general.svg\"\nimport { Symbol } from \"@planningcenter/icons/symbol\"\nimport React, { HTMLAttributes } from \"react\"\n\n// Registry of valid sprite sheet collections\n// We will add the other collections here when we / if we make this more publicly available\nconst validCollections = {\n general,\n} as const\n\ntype CollectionName = keyof typeof validCollections\n\nfunction isValidCollection(collection: string): collection is CollectionName {\n return collection in validCollections\n}\n\nfunction Icon({\n symbol: s,\n className,\n ...props\n}: { symbol: string } & HTMLAttributes<SVGSVGElement>) {\n const [collection, symbol] = s.split(\"#\") as [CollectionName, string]\n\n if (!isValidCollection(collection)) {\n throw new Error(\n `Unknown icon collection: ${collection}. Available collections: ${Object.keys(validCollections).join(\", \")}`\n )\n }\n\n const spriteSheet = validCollections[collection]\n return (\n <Symbol\n symbol={`${spriteSheet}#${symbol}`}\n className={className}\n {...props}\n />\n )\n}\n\nexport default Icon\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA,MAAM,gBAAgB,GAAG;IACvB,OAAO;CACC;AAIV,SAAS,iBAAiB,CAAC,UAAkB,EAAA;IAC3C,OAAO,UAAU,IAAI,gBAAgB;AACvC;AAEA,SAAS,IAAI,CAAC,EACZ,MAAM,EAAE,CAAC,EACT,SAAS,EACT,GAAG,KAAK,EAC2C,EAAA;AACnD,IAAA,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAA6B;AAErE,IAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE;AAClC,QAAA,MAAM,IAAI,KAAK,CACb,4BAA4B,UAAU,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAC7G;IACH;AAEA,IAAA,MAAM,WAAW,GAAG,gBAAgB,CAAC,UAAU,CAAC;AAChD,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,MAAM,IACL,MAAM,EAAE,GAAG,WAAW,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE,EAClC,SAAS,EAAE,SAAS,KAChB,KAAK,EAAA,CACT;AAEN;;;;"}
1
+ {"version":3,"file":"Icon.js","sources":["../../src/utilities/Icon.tsx"],"sourcesContent":["import general from \"@planningcenter/icons/sprites/general.svg\"\nimport { Symbol } from \"@planningcenter/icons/symbol\"\nimport React, { HTMLAttributes } from \"react\"\n\n// Registry of valid sprite sheet collections\n// We will add the other collections here when we / if we make this more publicly available\nconst validCollections = {\n general,\n} as const\n\ntype CollectionName = keyof typeof validCollections\n\nfunction isValidCollection(collection: string): collection is CollectionName {\n return collection in validCollections\n}\n\nfunction Icon({\n symbol: s,\n className,\n ...props\n}: { symbol: string } & HTMLAttributes<SVGSVGElement>) {\n const [collection, symbol] = s.split(\"#\") as [CollectionName, string]\n\n if (!isValidCollection(collection)) {\n throw new Error(\n `Unknown icon collection: ${collection}. Available collections: ${Object.keys(validCollections).join(\", \")}`\n )\n }\n\n const spriteSheet = validCollections[collection]\n return (\n <Symbol\n symbol={`${spriteSheet}#${symbol}`}\n className={className}\n {...props}\n />\n )\n}\n\nexport default Icon\n"],"names":["React"],"mappings":";;;;AAIA;AACA;AACA,MAAM,gBAAgB,GAAG;IACvB,OAAO;CACC;AAIV,SAAS,iBAAiB,CAAC,UAAkB,EAAA;IAC3C,OAAO,UAAU,IAAI,gBAAgB;AACvC;AAEA,SAAS,IAAI,CAAC,EACZ,MAAM,EAAE,CAAC,EACT,SAAS,EACT,GAAG,KAAK,EAC2C,EAAA;AACnD,IAAA,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAA6B;AAErE,IAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE;AAClC,QAAA,MAAM,IAAI,KAAK,CACb,4BAA4B,UAAU,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAC7G;IACH;AAEA,IAAA,MAAM,WAAW,GAAG,gBAAgB,CAAC,UAAU,CAAC;AAChD,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,MAAM,IACL,MAAM,EAAE,GAAG,WAAW,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE,EAClC,SAAS,EAAE,SAAS,KAChB,KAAK,EAAA,CACT;AAEN;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
 
3
3
  const COMPONENT_KIND_CLASS_MAP = {
4
4
  delete: "tds-btn--delete",
@@ -25,7 +25,7 @@ const COMPONENT_SIZE_CLASS_MAP = {
25
25
  xs: "tds-btn--xs",
26
26
  };
27
27
  function wrapStringWithSpan(content) {
28
- return typeof content === "string" ? React.createElement("span", null, content) : content;
28
+ return typeof content === "string" ? React__default.createElement("span", null, content) : content;
29
29
  }
30
30
 
31
31
  export { COMPONENT_KIND_CLASS_MAP, COMPONENT_SIZE_CLASS_MAP, wrapStringWithSpan };
@@ -1 +1 @@
1
- {"version":3,"file":"buttonLinkShared.js","sources":["../../src/utilities/buttonLinkShared.tsx"],"sourcesContent":["import React from \"react\"\n\nexport const COMPONENT_KIND_CLASS_MAP = {\n delete: \"tds-btn--delete\",\n ghost: \"tds-btn--ghost-neutral\",\n \"ghost-delete\": \"tds-btn--ghost-delete\",\n \"ghost-interaction\": \"tds-btn--ghost-interaction\",\n \"inline-text\": \"tds-btn--inline-text\",\n neutral: \"tds-btn--neutral\",\n \"neutral-inline\": \"tds-btn--neutral-inline\",\n pill: \"tds-btn--pill\",\n primary: \"tds-btn--interaction\",\n \"primary-page-header\": \"tds-btn--primary-page-header\",\n secondary: \"tds-btn--outline-neutral\",\n \"secondary-delete\": \"tds-btn--outline-delete\",\n \"secondary-interaction\": \"tds-btn--outline-interaction\",\n \"secondary-page-header\": \"tds-btn--secondary-page-header\",\n \"staff-only\": \"tds-btn--staff-only\",\n} as const\n\nexport const COMPONENT_SIZE_CLASS_MAP = {\n lg: \"tds-btn--lg\",\n md: \"\",\n sm: \"tds-btn--sm\",\n xl: \"tds-btn--xl\",\n xs: \"tds-btn--xs\",\n} as const\n\nexport type ComponentSize = keyof typeof COMPONENT_SIZE_CLASS_MAP\n\nexport type ComponentKind = keyof typeof COMPONENT_KIND_CLASS_MAP\n\nexport interface BaseComponentProps {\n /** Whether the component should take the full width of its container. */\n fullWidth?: boolean\n /** The visual style of the component. */\n kind?: ComponentKind\n /** A React node to display before the component's content. Set via story args for non-primitive values. */\n prefix?: React.ReactNode\n /** The size of the component. */\n size?: ComponentSize\n /** A React node to display after the component's content. Set via story args for non-primitive values. */\n suffix?: React.ReactNode\n}\n\nexport function wrapStringWithSpan(content: React.ReactNode): React.ReactNode {\n return typeof content === \"string\" ? <span>{content}</span> : content\n}\n"],"names":[],"mappings":";;AAEO,MAAM,wBAAwB,GAAG;AACtC,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,KAAK,EAAE,wBAAwB;AAC/B,IAAA,cAAc,EAAE,uBAAuB;AACvC,IAAA,mBAAmB,EAAE,4BAA4B;AACjD,IAAA,aAAa,EAAE,sBAAsB;AACrC,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,gBAAgB,EAAE,yBAAyB;AAC3C,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,SAAS,EAAE,0BAA0B;AACrC,IAAA,kBAAkB,EAAE,yBAAyB;AAC7C,IAAA,uBAAuB,EAAE,8BAA8B;AACvD,IAAA,uBAAuB,EAAE,gCAAgC;AACzD,IAAA,YAAY,EAAE,qBAAqB;;AAG9B,MAAM,wBAAwB,GAAG;AACtC,IAAA,EAAE,EAAE,aAAa;AACjB,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,aAAa;AACjB,IAAA,EAAE,EAAE,aAAa;AACjB,IAAA,EAAE,EAAE,aAAa;;AAoBb,SAAU,kBAAkB,CAAC,OAAwB,EAAA;AACzD,IAAA,OAAO,OAAO,OAAO,KAAK,QAAQ,GAAG,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,OAAO,CAAQ,GAAG,OAAO;AACvE;;;;"}
1
+ {"version":3,"file":"buttonLinkShared.js","sources":["../../src/utilities/buttonLinkShared.tsx"],"sourcesContent":["import React from \"react\"\n\nexport const COMPONENT_KIND_CLASS_MAP = {\n delete: \"tds-btn--delete\",\n ghost: \"tds-btn--ghost-neutral\",\n \"ghost-delete\": \"tds-btn--ghost-delete\",\n \"ghost-interaction\": \"tds-btn--ghost-interaction\",\n \"inline-text\": \"tds-btn--inline-text\",\n neutral: \"tds-btn--neutral\",\n \"neutral-inline\": \"tds-btn--neutral-inline\",\n pill: \"tds-btn--pill\",\n primary: \"tds-btn--interaction\",\n \"primary-page-header\": \"tds-btn--primary-page-header\",\n secondary: \"tds-btn--outline-neutral\",\n \"secondary-delete\": \"tds-btn--outline-delete\",\n \"secondary-interaction\": \"tds-btn--outline-interaction\",\n \"secondary-page-header\": \"tds-btn--secondary-page-header\",\n \"staff-only\": \"tds-btn--staff-only\",\n} as const\n\nexport const COMPONENT_SIZE_CLASS_MAP = {\n lg: \"tds-btn--lg\",\n md: \"\",\n sm: \"tds-btn--sm\",\n xl: \"tds-btn--xl\",\n xs: \"tds-btn--xs\",\n} as const\n\nexport type ComponentSize = keyof typeof COMPONENT_SIZE_CLASS_MAP\n\nexport type ComponentKind = keyof typeof COMPONENT_KIND_CLASS_MAP\n\nexport interface BaseComponentProps {\n /** Whether the component should take the full width of its container. */\n fullWidth?: boolean\n /** The visual style of the component. */\n kind?: ComponentKind\n /** A React node to display before the component's content. Set via story args for non-primitive values. */\n prefix?: React.ReactNode\n /** The size of the component. */\n size?: ComponentSize\n /** A React node to display after the component's content. Set via story args for non-primitive values. */\n suffix?: React.ReactNode\n}\n\nexport function wrapStringWithSpan(content: React.ReactNode): React.ReactNode {\n return typeof content === \"string\" ? <span>{content}</span> : content\n}\n"],"names":["React"],"mappings":";;AAEO,MAAM,wBAAwB,GAAG;AACtC,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,KAAK,EAAE,wBAAwB;AAC/B,IAAA,cAAc,EAAE,uBAAuB;AACvC,IAAA,mBAAmB,EAAE,4BAA4B;AACjD,IAAA,aAAa,EAAE,sBAAsB;AACrC,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,gBAAgB,EAAE,yBAAyB;AAC3C,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,SAAS,EAAE,0BAA0B;AACrC,IAAA,kBAAkB,EAAE,yBAAyB;AAC7C,IAAA,uBAAuB,EAAE,8BAA8B;AACvD,IAAA,uBAAuB,EAAE,gCAAgC;AACzD,IAAA,YAAY,EAAE,qBAAqB;;AAG9B,MAAM,wBAAwB,GAAG;AACtC,IAAA,EAAE,EAAE,aAAa;AACjB,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,aAAa;AACjB,IAAA,EAAE,EAAE,aAAa;AACjB,IAAA,EAAE,EAAE,aAAa;;AAoBb,SAAU,kBAAkB,CAAC,OAAwB,EAAA;AACzD,IAAA,OAAO,OAAO,OAAO,KAAK,QAAQ,GAAGA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,OAAO,CAAQ,GAAG,OAAO;AACvE;;;;"}
@@ -1,10 +1,39 @@
1
- import { createContext, useContext } from 'react';
2
- import { useLocale } from 'react-aria/I18nProvider';
1
+ import React__default, { createContext, useContext } from 'react';
2
+ import { useLocale, I18nProvider as I18nProvider$1 } from 'react-aria/I18nProvider';
3
3
 
4
+ let globalLocale;
5
+ /**
6
+ * Sets the locale DataTable, DatePicker and TimeField format dates with,
7
+ * app-wide. Call once at boot, before the first render; later calls don't
8
+ * re-render mounted components. An `I18nProvider` overrides it for its
9
+ * subtree. Pass `undefined` to fall back to the browser locale.
10
+ */
11
+ function setLocale(locale) {
12
+ globalLocale = locale;
13
+ }
4
14
  function canonicalLocale(locale) {
5
- return undefined;
15
+ if (!locale)
16
+ return undefined;
17
+ try {
18
+ return Intl.getCanonicalLocales(locale)[0];
19
+ }
20
+ catch {
21
+ return undefined;
22
+ }
6
23
  }
7
24
  const LocaleContext = createContext(undefined);
25
+ /**
26
+ * Sets the locale for a subtree, overriding `setLocale`. Use this instead of
27
+ * importing `I18nProvider` from `react-aria`: Tapestry can't see a provider
28
+ * from a separately installed copy. An invalid locale is ignored.
29
+ */
30
+ function I18nProvider({ children, locale }) {
31
+ const validLocale = canonicalLocale(locale);
32
+ if (!validLocale)
33
+ return React__default.createElement(React__default.Fragment, null, children);
34
+ return (React__default.createElement(LocaleContext.Provider, { value: validLocale },
35
+ React__default.createElement(I18nProvider$1, { locale: validLocale }, children)));
36
+ }
8
37
  /**
9
38
  * Resolves the nearest `I18nProvider`, then `setLocale`, then the browser
10
39
  * locale. An invalid locale falls through to the next one.
@@ -12,8 +41,8 @@ const LocaleContext = createContext(undefined);
12
41
  function useTapestryLocale() {
13
42
  const providerLocale = useContext(LocaleContext);
14
43
  const { locale: defaultLocale } = useLocale();
15
- return providerLocale ?? canonicalLocale() ?? defaultLocale;
44
+ return providerLocale ?? canonicalLocale(globalLocale) ?? defaultLocale;
16
45
  }
17
46
 
18
- export { useTapestryLocale };
47
+ export { I18nProvider, setLocale, useTapestryLocale };
19
48
  //# sourceMappingURL=locale.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"locale.js","sources":["../../src/utilities/locale.tsx"],"sourcesContent":["import React, { createContext, type ReactNode, useContext } from \"react\"\nimport {\n I18nProvider as AriaI18nProvider,\n useLocale,\n} from \"react-aria/I18nProvider\"\n\nlet globalLocale: string | undefined\n\n/**\n * Sets the locale DataTable, DatePicker and TimeField format dates with,\n * app-wide. Call once at boot, before the first render; later calls don't\n * re-render mounted components. An `I18nProvider` overrides it for its\n * subtree. Pass `undefined` to fall back to the browser locale.\n */\nexport function setLocale(locale: string | undefined) {\n globalLocale = locale\n}\n\nfunction canonicalLocale(locale: string | undefined) {\n if (!locale) return undefined\n try {\n return Intl.getCanonicalLocales(locale)[0]\n } catch {\n return undefined\n }\n}\n\nconst LocaleContext = createContext<string | undefined>(undefined)\n\nexport interface I18nProviderProps {\n children: ReactNode\n /** A BCP 47 language tag, e.g. `en-GB`. */\n locale: string\n}\n\n/**\n * Sets the locale for a subtree, overriding `setLocale`. Use this instead of\n * importing `I18nProvider` from `react-aria`: Tapestry can't see a provider\n * from a separately installed copy. An invalid locale is ignored.\n */\nexport function I18nProvider({ children, locale }: I18nProviderProps) {\n const validLocale = canonicalLocale(locale)\n if (!validLocale) return <>{children}</>\n\n return (\n <LocaleContext.Provider value={validLocale}>\n <AriaI18nProvider locale={validLocale}>{children}</AriaI18nProvider>\n </LocaleContext.Provider>\n )\n}\n\n/**\n * Resolves the nearest `I18nProvider`, then `setLocale`, then the browser\n * locale. An invalid locale falls through to the next one.\n */\nexport function useTapestryLocale() {\n const providerLocale = useContext(LocaleContext)\n const { locale: defaultLocale } = useLocale()\n return providerLocale ?? canonicalLocale(globalLocale) ?? defaultLocale\n}\n"],"names":[],"mappings":";;;AAkBA,SAAS,eAAe,CAAC,MAA0B,EAAA;AACjD,IAAa,OAAO,SAAS;AAM/B;AAEA,MAAM,aAAa,GAAG,aAAa,CAAqB,SAAS,CAAC;AAwBlE;;;AAGG;SACa,iBAAiB,GAAA;AAC/B,IAAA,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAChD,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE;IAC7C,OAAO,cAAc,IAAI,eAAe,CAAa,CAAC,IAAI,aAAa;AACzE;;;;"}
1
+ {"version":3,"file":"locale.js","sources":["../../src/utilities/locale.tsx"],"sourcesContent":["import React, { createContext, type ReactNode, useContext } from \"react\"\nimport {\n I18nProvider as AriaI18nProvider,\n useLocale,\n} from \"react-aria/I18nProvider\"\n\nlet globalLocale: string | undefined\n\n/**\n * Sets the locale DataTable, DatePicker and TimeField format dates with,\n * app-wide. Call once at boot, before the first render; later calls don't\n * re-render mounted components. An `I18nProvider` overrides it for its\n * subtree. Pass `undefined` to fall back to the browser locale.\n */\nexport function setLocale(locale: string | undefined) {\n globalLocale = locale\n}\n\nfunction canonicalLocale(locale: string | undefined) {\n if (!locale) return undefined\n try {\n return Intl.getCanonicalLocales(locale)[0]\n } catch {\n return undefined\n }\n}\n\nconst LocaleContext = createContext<string | undefined>(undefined)\n\nexport interface I18nProviderProps {\n children: ReactNode\n /** A BCP 47 language tag, e.g. `en-GB`. */\n locale: string\n}\n\n/**\n * Sets the locale for a subtree, overriding `setLocale`. Use this instead of\n * importing `I18nProvider` from `react-aria`: Tapestry can't see a provider\n * from a separately installed copy. An invalid locale is ignored.\n */\nexport function I18nProvider({ children, locale }: I18nProviderProps) {\n const validLocale = canonicalLocale(locale)\n if (!validLocale) return <>{children}</>\n\n return (\n <LocaleContext.Provider value={validLocale}>\n <AriaI18nProvider locale={validLocale}>{children}</AriaI18nProvider>\n </LocaleContext.Provider>\n )\n}\n\n/**\n * Resolves the nearest `I18nProvider`, then `setLocale`, then the browser\n * locale. An invalid locale falls through to the next one.\n */\nexport function useTapestryLocale() {\n const providerLocale = useContext(LocaleContext)\n const { locale: defaultLocale } = useLocale()\n return providerLocale ?? canonicalLocale(globalLocale) ?? defaultLocale\n}\n"],"names":["React","AriaI18nProvider"],"mappings":";;;AAMA,IAAI,YAAgC;AAEpC;;;;;AAKG;AACG,SAAU,SAAS,CAAC,MAA0B,EAAA;IAClD,YAAY,GAAG,MAAM;AACvB;AAEA,SAAS,eAAe,CAAC,MAA0B,EAAA;AACjD,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,SAAS;AAC7B,IAAA,IAAI;QACF,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5C;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,SAAS;IAClB;AACF;AAEA,MAAM,aAAa,GAAG,aAAa,CAAqB,SAAS,CAAC;AAQlE;;;;AAIG;SACa,YAAY,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAqB,EAAA;AAClE,IAAA,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,CAAC,WAAW;QAAE,OAAOA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,EAAG,QAAQ,CAAI;IAExC,QACEA,6BAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,WAAW,EAAA;QACxCA,cAAA,CAAA,aAAA,CAACC,cAAgB,EAAA,EAAC,MAAM,EAAE,WAAW,IAAG,QAAQ,CAAoB,CAC7C;AAE7B;AAEA;;;AAGG;SACa,iBAAiB,GAAA;AAC/B,IAAA,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAChD,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE;IAC7C,OAAO,cAAc,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,aAAa;AACzE;;;;"}
@@ -10,7 +10,7 @@ use_when:
10
10
  ## Rules
11
11
 
12
12
  - **Do** show every filter that narrows the results as a filter chip, including the filters a default view applies, so people can see why rows are missing.
13
- - **Do** Make the subset most people want, like active people, the default view: a system view (`staticViews`) set as the default with `initialDefaultViewId`.
13
+ - **Do** Give a table that opens filtered a system view with the id `"initial"` that holds those filters, like “Active”. It’s the default view, and after Clear filters it’s the one-click way back.
14
14
  - **Do** Make the row the way to open its item (`getRowLink` or `onRowClick`). Put every other action in `rowActions`.
15
15
  - **Do** Name the records with `resultNoun`, like `["person", "people"]`. It labels the count (“1,240 people”), the table and the pagination for screen readers.
16
16
  - **Do** Write an `emptyState` that says why the table is empty and, when it helps, how to change that.
@@ -73,12 +73,14 @@ A view is a named set of filters, sort and visible columns, so people can get ba
73
73
  >
74
74
  > Same thing. Design calls them system views; the prop, the code and the API docs call them static views.
75
75
 
76
- - **“All” is always first.** The table adds it, so the full set is always one click away. It can’t be removed. A system view with the id `"initial"` replaces it, for the rare table that has a reason not to start from everything.
77
- - **Default views can have filters.** When most people come to the table for a subset, make that subset the default rather than making everyone filter it each visit.
78
- - **Use a system view for a filtered default.** Add the subset to `staticViews` and pass its id as `initialDefaultViewId`. Its filters show as chips like any other filters, so people can see what’s hidden and switch to “All”.
76
+ - **“All” comes first unless the table opens filtered.** The table adds an “All” view with the id `"initial"`, the default view, so the full set is one click away. A system view with the id `"initial"` replaces it.
77
+ - **Default views can have filters.** When most people come to the table for a subset, like active people or current background checks, make that subset the default rather than making everyone filter it each visit.
78
+ - **A table that opens filtered needs a system view for those filters.** Add them to `staticViews` as a view with the id `"initial"`. It replaces “All” and is the default view without setting `initialDefaultViewId`. Its filters show as chips like any other filters. Clear filters removes them all to show the full set; it doesn’t go back to the defaults, so this view is how people get back in one click. Add it even when it’s the only system view. Without it, getting back means adding each filter again.
79
+ - **Name the default view for what it shows,** like “Active” or “Current”, not “Default view” or “Initial”. Each product picks the name that fits its records.
79
80
  - **Load the default view’s results on first render.** The table doesn’t apply the default view; it only selects it when the first `activeFilters`, sort and visible columns match it. Load the page with the default view’s filters so the view and the rows agree.
80
81
  - **Name views for what they show,** 1–3 words in sentence case, like “Active” or “Joined this year”. Don’t name them for who uses them or what they’re for; people pick a view by what they expect to see.
81
82
  - **Keep system views few.** Add one when many people need the same subset. Leave narrower subsets to saved views, so the views bar stays short.
83
+ - **A changed system view isn’t selected.** People can’t update or discard changes to a system view, so once its filters, sort or columns change, the views bar stops showing it as selected. Picking it again puts its filters back.
82
84
 
83
85
  How people manage saved views:
84
86
 
@@ -109,9 +111,25 @@ How people manage saved views:
109
111
  | Open a related item, like a household’s primary contact | A row action, or a link on the opened item |
110
112
 
111
113
  - Prefer `getRowLink` over `onRowClick` when the item has its own page, so people can open it in a new tab.
112
- - One row action shows as a button. Two or more go in a menu. Put destructive actions last, with `kind="destructive"`.
114
+ - One row action shows as a button. Two or more go in a menu on every row, even a row that hides all but one, so actions stay in the same place down the column. Put destructive actions last, with `kind="destructive"`.
115
+ - Use `hidden: true` for an action the person can’t use on any row, like one they don’t have permission for. Use a `hidden` function only when it depends on the row; otherwise every row gets a menu with a single item.
113
116
  - Table actions are icon buttons, so give each a short `label`. It becomes the tooltip and the accessible name.
114
117
 
118
+ ### Row appearance
119
+
120
+ `getRowAppearance` gives a row one of a few fixed looks. Tapestry owns how each looks, so the same meaning looks the same across Planning Center.
121
+
122
+ | Need | Use |
123
+ | --------------------------------------------------------- | --------- |
124
+ | Point to rows after an action elsewhere, like a date pick | `reveal` |
125
+ | Mark a row that needs attention | `flagged` |
126
+ | Call out a recently added row | `new` |
127
+ | Play down a less relevant row, like an inactive one | `muted` |
128
+
129
+ - Give flagged and new rows a visible indicator in a cell too, like an icon or a badge. Color can’t be the only signal.
130
+ - A reveal doesn’t move focus. When it matters, announce it in a status message, like “3 events on November 9”.
131
+ - Don’t style rows with your own classes; ask for a new appearance when the fixed set doesn’t fit.
132
+
115
133
  ### Selection
116
134
 
117
135
  - `selectable` adds a checkbox to each row and a select-all checkbox in the header. The header checkbox selects only the rows on this page.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/tapestry",
3
- "version": "4.15.0-rc.1",
3
+ "version": "4.15.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -143,5 +143,5 @@
143
143
  "react-stately": "3.49.0",
144
144
  "use-sync-external-store": "^1.7.0"
145
145
  },
146
- "gitHead": "596805012ac0747352591d0a6d797dfc15f8c6b9"
146
+ "gitHead": "b83f176c5918f3e5750a4c398b5cf7f1deab62a6"
147
147
  }