@12-apps/ui 6.8.0 → 6.10.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 (38) hide show
  1. package/dist/chunk-3X3JVF6E.js +438 -0
  2. package/dist/chunk-3X3JVF6E.js.map +1 -0
  3. package/dist/chunk-AL3W7TXN.js +465 -0
  4. package/dist/chunk-AL3W7TXN.js.map +1 -0
  5. package/dist/en-US.js +56 -0
  6. package/dist/en-US.js.map +1 -0
  7. package/dist/locales.js +171 -0
  8. package/dist/locales.js.map +1 -0
  9. package/dist/pt-BR.js +27 -410
  10. package/dist/pt-BR.js.map +1 -1
  11. package/dist/types/en-US.d.ts +24 -0
  12. package/dist/types/en-US.d.ts.map +1 -0
  13. package/dist/types/en-US.data-display.d.ts +13 -0
  14. package/dist/types/en-US.data-display.d.ts.map +1 -0
  15. package/dist/types/en-US.feedback.d.ts +8 -0
  16. package/dist/types/en-US.feedback.d.ts.map +1 -0
  17. package/dist/types/en-US.form.d.ts +13 -0
  18. package/dist/types/en-US.form.d.ts.map +1 -0
  19. package/dist/types/en-US.layout.d.ts +7 -0
  20. package/dist/types/en-US.layout.d.ts.map +1 -0
  21. package/dist/types/en-US.navigation.d.ts +8 -0
  22. package/dist/types/en-US.navigation.d.ts.map +1 -0
  23. package/dist/types/en-US.shared.d.ts +26 -0
  24. package/dist/types/en-US.shared.d.ts.map +1 -0
  25. package/dist/types/en-US.utility.d.ts +8 -0
  26. package/dist/types/en-US.utility.d.ts.map +1 -0
  27. package/dist/types/locales.d.ts +53 -0
  28. package/dist/types/locales.d.ts.map +1 -0
  29. package/package.json +16 -4
  30. package/src/en-US.data-display.ts +244 -0
  31. package/src/en-US.feedback.ts +25 -0
  32. package/src/en-US.form.ts +103 -0
  33. package/src/en-US.layout.ts +15 -0
  34. package/src/en-US.navigation.ts +23 -0
  35. package/src/en-US.shared.ts +105 -0
  36. package/src/en-US.ts +24 -0
  37. package/src/en-US.utility.ts +24 -0
  38. package/src/locales.ts +151 -0
@@ -0,0 +1,103 @@
1
+ /**
2
+ * The en-US pack for the form family. Split the same way `pt-BR.form.ts` is —
3
+ * see `en-US.ts` for why.
4
+ */
5
+ import type {
6
+ AddressAutocompleteCopy,
7
+ AutocompleteCopy,
8
+ CodeEditorCopy,
9
+ PasswordStrengthCopy,
10
+ PhoneInputCopy,
11
+ RichEditorToolbarCopy,
12
+ UploadButtonCopy,
13
+ } from './copy';
14
+
15
+ export const EN_US_ADDRESS_AUTOCOMPLETE_COPY: AddressAutocompleteCopy = {
16
+ loadingMaps: "Loading Google Maps…",
17
+ mapsLoadFailed:
18
+ "Could not load the Google Maps API. Check the API key and the internet connection.",
19
+ useCurrentLocation: "Use my current location",
20
+ };
21
+
22
+ export const EN_US_AUTOCOMPLETE_COPY: AutocompleteCopy = {
23
+ loading: "Loading…",
24
+ noResults: "No results found",
25
+ placeholder: "Type to search…",
26
+ };
27
+
28
+ export const EN_US_CODE_EDITOR_COPY: CodeEditorCopy = {
29
+ loading: "Loading the editor…",
30
+ readOnly: "Read only",
31
+ // The shortcut is the editor's own binding and is not translated — it is what
32
+ // the reader must press, not something they read.
33
+ formatCode: "Format code (Ctrl+Shift+F)",
34
+ enableWrap: "Wrap lines",
35
+ disableWrap: "Do not wrap lines",
36
+ copyToClipboard: "Copy to clipboard",
37
+ copied: "Copied!",
38
+ enterFullscreen: "Full screen",
39
+ exitFullscreen: "Leave full screen",
40
+ };
41
+
42
+ export const EN_US_PASSWORD_STRENGTH_COPY: PasswordStrengthCopy = {
43
+ strengthHeading: "Password strength",
44
+ requirementsHeading: "Requirements:",
45
+ suggestionsHeading: "Suggestions:",
46
+ bands: {
47
+ veryWeak: "Very weak",
48
+ weak: "Weak",
49
+ fair: "Fair",
50
+ good: "Good",
51
+ strong: "Strong",
52
+ },
53
+ requirements: {
54
+ // The count is the HOST's configured minimum, interpolated rather than
55
+ // written out: a host raising it must not end up with a requirement naming
56
+ // the old number.
57
+ minLength: (count) => `At least ${count} characters`,
58
+ uppercase: "One uppercase letter",
59
+ lowercase: "One lowercase letter",
60
+ numbers: "One number",
61
+ special: "One special character",
62
+ },
63
+ suggestions: {
64
+ minLength: (count) => `Use at least ${count} characters`,
65
+ uppercase: "Add uppercase letters",
66
+ lowercase: "Add lowercase letters",
67
+ numbers: "Include numbers",
68
+ special: "Add special characters",
69
+ },
70
+ };
71
+
72
+ export const EN_US_RICH_EDITOR_TOOLBAR_COPY: RichEditorToolbarCopy = {
73
+ bold: "Bold",
74
+ italic: "Italic",
75
+ underline: "Underline",
76
+ bulletList: "Bulleted list",
77
+ numberedList: "Numbered list",
78
+ quote: "Quote",
79
+ code: "Code",
80
+ insertLink: "Insert link",
81
+ textColor: "Text colour",
82
+ backgroundColor: "Background colour",
83
+ linkPrompt: "Enter the URL:",
84
+ };
85
+
86
+ export const EN_US_PHONE_INPUT_COPY: PhoneInputCopy = {
87
+ selectCountry: "Select country",
88
+ invalidNumber: (countryName) => `Not a valid phone number for ${countryName}`,
89
+ // Substituted into the sentence above when no country is chosen, so it has to
90
+ // read as a noun phrase inside it rather than as a sentence of its own.
91
+ unknownCountry: "the selected country",
92
+ };
93
+
94
+ export const EN_US_UPLOAD_BUTTON_COPY: UploadButtonCopy = {
95
+ buttonLabel: "Upload a file",
96
+ dropzoneHint: "Drop the file here, or click to choose one",
97
+ dropzoneRole: (label) => `File upload area. ${label}`,
98
+ uploading: "Uploading…",
99
+ dropReady: "File ready to drop",
100
+ percentUploaded: (percent) => `${percent}% uploaded`,
101
+ uploadInProgress: (percent) => `Upload in progress: ${percent}%`,
102
+ errorAnnouncement: (message) => `Error: ${message}`,
103
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The en-US pack for the layout family. Split the same way `pt-BR.layout.ts`
3
+ * is — see `en-US.ts` for why the packs live in per-family files.
4
+ */
5
+ import type {
6
+ TableFilterCopy,
7
+ } from './copy';
8
+
9
+ export const EN_US_TABLE_FILTER_COPY: TableFilterCopy = {
10
+ clearAllFilters: "Clear all filters",
11
+ clearKeyword: "Clear the search",
12
+ invalidRange: "The maximum must be greater than or equal to the minimum.",
13
+ rangeMin: "Minimum",
14
+ rangeMax: "Maximum",
15
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The en-US pack for the navigation family. Split the same way
3
+ * `pt-BR.navigation.ts` is — see `en-US.ts` for why.
4
+ */
5
+ import type {
6
+ BreadcrumbCopy,
7
+ CommandPaletteCopy,
8
+ } from './copy';
9
+
10
+ export const EN_US_COMMAND_PALETTE_COPY: CommandPaletteCopy = {
11
+ execute: "Run",
12
+ // The arrow glyphs and the key name are part of the hint a reader looks at
13
+ // while their hands are on the keyboard, so they survive translation intact.
14
+ navigate: "↑↓ Navigate",
15
+ close: "ESC Close",
16
+ recent: "Recent",
17
+ tryAnotherTerm: "Try another term",
18
+ };
19
+
20
+ export const EN_US_BREADCRUMB_COPY: BreadcrumbCopy = {
21
+ showMore: "Show more",
22
+ moreItems: "More items",
23
+ };
@@ -0,0 +1,105 @@
1
+ /**
2
+ * The en-US pack for the shared family. Split the same way `pt-BR.shared.ts`
3
+ * is — see `en-US.ts` for why.
4
+ */
5
+ import type { SavedViewsLabels } from "./components/layout/ContentToolbar/ContentToolbar.types";
6
+ import type {
7
+ CategorySelectCopy,
8
+ CepFieldCopy,
9
+ ConfirmActionCopy,
10
+ SectionOnboardingCopy,
11
+ } from './copy';
12
+
13
+ export const EN_US_SECTION_ONBOARDING_COPY: SectionOnboardingCopy = {
14
+ edit: "Edit",
15
+ collapse: "Hide",
16
+ start: "Start",
17
+ };
18
+
19
+ export const EN_US_CONFIRM_ACTION_COPY: ConfirmActionCopy = {
20
+ cancel: "Cancel",
21
+ defaultError: "That action could not be completed. Try again.",
22
+ irreversible: "This cannot be undone.",
23
+ // The expected word is what the reader must type, and it is the HOST's word.
24
+ // It is interpolated rather than translated: a dialog that asks for one word
25
+ // and matches on another can never be confirmed.
26
+ typeToConfirm: (expected) => `Type "${expected}" to confirm.`,
27
+ };
28
+
29
+ export const EN_US_CATEGORY_SELECT_COPY: CategorySelectCopy = {
30
+ purpose: "Categories organise the menu and the filters shoppers see.",
31
+ clearSelection: "Clear selection",
32
+ selectAll: "Select all",
33
+ deselectAll: "Deselect all",
34
+ expandAll: "Expand all",
35
+ collapseAll: "Collapse all",
36
+ expandCategory: (name) => `Expand ${name}`,
37
+ collapseCategory: (name) => `Collapse ${name}`,
38
+ placeholderSingle: "Move to…",
39
+ placeholderMulti: "Category",
40
+ emptyTitle: "No categories yet",
41
+ createCategory: "Create category",
42
+ noResults: {
43
+ title: (query) => `Nothing found for “${query}”`,
44
+ hint: "Try another term, or check the spelling.",
45
+ clearSearch: "Clear search",
46
+ create: (query) => `Create “${query}”`,
47
+ },
48
+ search: {
49
+ placeholderSingle: "Search categories…",
50
+ placeholderMulti: "Search a category or subcategory",
51
+ clear: "Clear search",
52
+ removeChip: (label) => `Remove ${label}`,
53
+ pinnedLabel: (count) => `Selected · ${count}`,
54
+ },
55
+ footer: {
56
+ // The pt-BR pack pluralises with a suffix; English changes the noun, so the
57
+ // whole word is chosen here. Each locale owning its own plural rule is the
58
+ // reason these are functions rather than templates.
59
+ selectedCount: (count) => `${count} ${count === 1 ? "category" : "categories"} selected`,
60
+ clear: "Clear",
61
+ apply: "Apply",
62
+ close: "Close",
63
+ singleHint: "Pick one category",
64
+ cancel: "Cancel",
65
+ },
66
+ };
67
+
68
+ /**
69
+ * CEP is Brazil's postal code and is NOT translated: the field looks up a
70
+ * Brazilian address by a Brazilian code, and calling it a "ZIP code" in the
71
+ * error would send an English-reading operator hunting for a field that does
72
+ * not exist. The surrounding sentences are English; the code's name is a proper
73
+ * noun, the same way a vendor's own field name is.
74
+ */
75
+ export const EN_US_CEP_FIELD_COPY: CepFieldCopy = {
76
+ loading: "Looking up the address…",
77
+ found: "Address filled in from the CEP.",
78
+ notfound: "CEP not found — fill the address in by hand.",
79
+ };
80
+
81
+ /**
82
+ * The saved-views dropdown's labels.
83
+ *
84
+ * Typed as the package's OWN `SavedViewsLabels` rather than a parallel shape,
85
+ * for the reason `pt-BR.shared.ts` records: that interface already named every
86
+ * string, including the seven with no diacritics the copy gate could not see.
87
+ */
88
+ export const EN_US_SAVED_VIEWS_LABELS: SavedViewsLabels = {
89
+ trigger: "Views",
90
+ mainView: "Main view",
91
+ pinned: "Pinned",
92
+ recent: "Recent",
93
+ empty: "No saved views yet.",
94
+ saveCurrent: "+ Save current view",
95
+ manageAll: "Manage views",
96
+ apply: "Apply",
97
+ setDefault: "Set as default",
98
+ pin: "Pin to the sidebar",
99
+ unpin: "Unpin",
100
+ share: "Share with the team",
101
+ unshare: "Make private",
102
+ edit: "Edit",
103
+ remove: "Delete",
104
+ defaultTag: "Default",
105
+ };
package/src/en-US.ts ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The en-US packs — NAMED constants a host passes by hand, never defaults.
3
+ *
4
+ * The filename is what exempts this file from the copy-portability gate,
5
+ * exactly as `pt-BR.ts` beside it is exempt: a language may ship, it may not be
6
+ * silent. `@12-apps/ui` is the package EVERY host renders, so a default
7
+ * compiled in here would reach every adopter of every other package too — which
8
+ * is the leak the copy port closed and the reason a second language arrives as
9
+ * a second named pack rather than as a fallback.
10
+ *
11
+ * A BARREL over `./en-US.<family>.ts`, mirroring the pt-BR side one for one.
12
+ * Each part keeps its tag in its own FILENAME rather than sitting in an
13
+ * `en-US/` folder, because the portability gates' exemption is a filename rule
14
+ * (`lib/locale-tag.mjs`): a folder would have put seven files of copy back in
15
+ * scope. Consumers read `@12-apps/ui/en-US`.
16
+ */
17
+
18
+ export * from './en-US.data-display';
19
+ export * from './en-US.feedback';
20
+ export * from './en-US.form';
21
+ export * from './en-US.layout';
22
+ export * from './en-US.navigation';
23
+ export * from './en-US.shared';
24
+ export * from './en-US.utility';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The en-US pack for the utility family. Split the same way
3
+ * `pt-BR.utility.ts` is — see `en-US.ts` for why.
4
+ */
5
+ import type {
6
+ InstallPromptCopy,
7
+ UserAvatarCopy,
8
+ } from './copy';
9
+
10
+ export const EN_US_INSTALL_PROMPT_COPY: InstallPromptCopy = {
11
+ title: "Install this app",
12
+ installLabel: "Install",
13
+ dismissLabel: "Dismiss the install prompt",
14
+ // The two halves wrap the platform's share glyph, which the component renders
15
+ // between them. Splitting the sentence is what lets the icon sit inline, so
16
+ // the translation has to keep the same seam rather than one whole sentence.
17
+ iosTapBefore: "Tap",
18
+ iosTapAfter: 'and then "Add to Home Screen"',
19
+ shareLabel: "Share",
20
+ };
21
+
22
+ export const EN_US_USER_AVATAR_COPY: UserAvatarCopy = {
23
+ signOut: "Sign out",
24
+ };
package/src/locales.ts ADDED
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Every component family's copy, in both languages, keyed by tag.
3
+ *
4
+ * One pack per family rather than one giant pack, because that is how the
5
+ * components take it: six of these are mounted independently and each takes
6
+ * what it renders, while the DataViews family threads one object through a
7
+ * context. A single blob would force a host mounting one component to state
8
+ * copy for ninety.
9
+ *
10
+ * ```ts
11
+ * import { useLocaleCopy } from '@12-apps/i18n/react';
12
+ * const copy = useLocaleCopy(LIGHTBOX_COPY);
13
+ * ```
14
+ *
15
+ * `LocalePack` is mirrored here rather than imported from `@12-apps/i18n`: this
16
+ * package is the one EVERY host renders, and giving it a dependency to carry a
17
+ * type would push that dependency onto every adopter of every other package.
18
+ * The mirror buys the same key-checking for one line.
19
+ */
20
+ import type { DataViewsCopy } from './components/data-display/DataViews/data-views-copy';
21
+ import type { SavedViewsLabels } from './components/layout/ContentToolbar/ContentToolbar.types';
22
+ import type {
23
+ AddressAutocompleteCopy,
24
+ AutocompleteCopy,
25
+ BreadcrumbCopy,
26
+ CarouselCopy,
27
+ CategorySelectCopy,
28
+ CepFieldCopy,
29
+ ChromeCopy,
30
+ CodeEditorCopy,
31
+ CommandPaletteCopy,
32
+ ConfirmActionCopy,
33
+ DataStateCopy,
34
+ InstallPromptCopy,
35
+ LightboxCopy,
36
+ MapPreviewCopy,
37
+ PasswordStrengthCopy,
38
+ PhoneInputCopy,
39
+ RichEditorToolbarCopy,
40
+ SectionOnboardingCopy,
41
+ TableFilterCopy,
42
+ TimingDiagramCopy,
43
+ TutorialCopy,
44
+ UploadButtonCopy,
45
+ UserAvatarCopy,
46
+ } from './copy';
47
+ import * as en from './en-US';
48
+ import * as pt from './pt-BR';
49
+
50
+ type LocalePack<T> = { readonly 'pt-BR': T; readonly 'en-US': T };
51
+
52
+ const pack = <T,>(ptBR: T, enUS: T): LocalePack<T> => ({ 'pt-BR': ptBR, 'en-US': enUS });
53
+
54
+ // data-display
55
+ export const LIGHTBOX_COPY = pack<LightboxCopy>(pt.PT_BR_LIGHTBOX_COPY, en.EN_US_LIGHTBOX_COPY);
56
+ export const MAP_PREVIEW_COPY = pack<MapPreviewCopy>(
57
+ pt.PT_BR_MAP_PREVIEW_COPY,
58
+ en.EN_US_MAP_PREVIEW_COPY,
59
+ );
60
+ export const CAROUSEL_COPY = pack<CarouselCopy>(pt.PT_BR_CAROUSEL_COPY, en.EN_US_CAROUSEL_COPY);
61
+ export const TIMING_DIAGRAM_COPY = pack<TimingDiagramCopy>(
62
+ pt.PT_BR_TIMING_DIAGRAM_COPY,
63
+ en.EN_US_TIMING_DIAGRAM_COPY,
64
+ );
65
+ export const DATA_STATE_COPY = pack<DataStateCopy>(
66
+ pt.PT_BR_DATA_STATE_COPY,
67
+ en.EN_US_DATA_STATE_COPY,
68
+ );
69
+ export const DATA_VIEWS_COPY = pack<DataViewsCopy>(
70
+ pt.PT_BR_DATA_VIEWS_COPY,
71
+ en.EN_US_DATA_VIEWS_COPY,
72
+ );
73
+
74
+ // feedback
75
+ export const TUTORIAL_COPY = pack<TutorialCopy>(pt.PT_BR_TUTORIAL_COPY, en.EN_US_TUTORIAL_COPY);
76
+ export const CHROME_COPY = pack<ChromeCopy>(pt.PT_BR_CHROME_COPY, en.EN_US_CHROME_COPY);
77
+
78
+ // form
79
+ export const ADDRESS_AUTOCOMPLETE_COPY = pack<AddressAutocompleteCopy>(
80
+ pt.PT_BR_ADDRESS_AUTOCOMPLETE_COPY,
81
+ en.EN_US_ADDRESS_AUTOCOMPLETE_COPY,
82
+ );
83
+ export const AUTOCOMPLETE_COPY = pack<AutocompleteCopy>(
84
+ pt.PT_BR_AUTOCOMPLETE_COPY,
85
+ en.EN_US_AUTOCOMPLETE_COPY,
86
+ );
87
+ export const CODE_EDITOR_COPY = pack<CodeEditorCopy>(
88
+ pt.PT_BR_CODE_EDITOR_COPY,
89
+ en.EN_US_CODE_EDITOR_COPY,
90
+ );
91
+ export const PASSWORD_STRENGTH_COPY = pack<PasswordStrengthCopy>(
92
+ pt.PT_BR_PASSWORD_STRENGTH_COPY,
93
+ en.EN_US_PASSWORD_STRENGTH_COPY,
94
+ );
95
+ export const RICH_EDITOR_TOOLBAR_COPY = pack<RichEditorToolbarCopy>(
96
+ pt.PT_BR_RICH_EDITOR_TOOLBAR_COPY,
97
+ en.EN_US_RICH_EDITOR_TOOLBAR_COPY,
98
+ );
99
+ export const PHONE_INPUT_COPY = pack<PhoneInputCopy>(
100
+ pt.PT_BR_PHONE_INPUT_COPY,
101
+ en.EN_US_PHONE_INPUT_COPY,
102
+ );
103
+ export const UPLOAD_BUTTON_COPY = pack<UploadButtonCopy>(
104
+ pt.PT_BR_UPLOAD_BUTTON_COPY,
105
+ en.EN_US_UPLOAD_BUTTON_COPY,
106
+ );
107
+
108
+ // layout
109
+ export const TABLE_FILTER_COPY = pack<TableFilterCopy>(
110
+ pt.PT_BR_TABLE_FILTER_COPY,
111
+ en.EN_US_TABLE_FILTER_COPY,
112
+ );
113
+
114
+ // navigation
115
+ export const COMMAND_PALETTE_COPY = pack<CommandPaletteCopy>(
116
+ pt.PT_BR_COMMAND_PALETTE_COPY,
117
+ en.EN_US_COMMAND_PALETTE_COPY,
118
+ );
119
+ export const BREADCRUMB_COPY = pack<BreadcrumbCopy>(
120
+ pt.PT_BR_BREADCRUMB_COPY,
121
+ en.EN_US_BREADCRUMB_COPY,
122
+ );
123
+
124
+ // shared
125
+ export const SECTION_ONBOARDING_COPY = pack<SectionOnboardingCopy>(
126
+ pt.PT_BR_SECTION_ONBOARDING_COPY,
127
+ en.EN_US_SECTION_ONBOARDING_COPY,
128
+ );
129
+ export const CONFIRM_ACTION_COPY = pack<ConfirmActionCopy>(
130
+ pt.PT_BR_CONFIRM_ACTION_COPY,
131
+ en.EN_US_CONFIRM_ACTION_COPY,
132
+ );
133
+ export const CATEGORY_SELECT_COPY = pack<CategorySelectCopy>(
134
+ pt.PT_BR_CATEGORY_SELECT_COPY,
135
+ en.EN_US_CATEGORY_SELECT_COPY,
136
+ );
137
+ export const CEP_FIELD_COPY = pack<CepFieldCopy>(pt.PT_BR_CEP_FIELD_COPY, en.EN_US_CEP_FIELD_COPY);
138
+ export const SAVED_VIEWS_LABELS = pack<SavedViewsLabels>(
139
+ pt.PT_BR_SAVED_VIEWS_LABELS,
140
+ en.EN_US_SAVED_VIEWS_LABELS,
141
+ );
142
+
143
+ // utility
144
+ export const INSTALL_PROMPT_COPY = pack<InstallPromptCopy>(
145
+ pt.PT_BR_INSTALL_PROMPT_COPY,
146
+ en.EN_US_INSTALL_PROMPT_COPY,
147
+ );
148
+ export const USER_AVATAR_COPY = pack<UserAvatarCopy>(
149
+ pt.PT_BR_USER_AVATAR_COPY,
150
+ en.EN_US_USER_AVATAR_COPY,
151
+ );