@box/unified-share-modal 2.12.15 → 2.12.17

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 (95) hide show
  1. package/dist/chunks/classification-status.js +62 -0
  2. package/dist/chunks/collaboration-role.js +89 -0
  3. package/dist/chunks/collaboration-section.js +156 -0
  4. package/dist/chunks/collaborator-list-item.js +61 -0
  5. package/dist/chunks/collaborator-list.js +74 -0
  6. package/dist/chunks/remove-collaborator-modal.js +61 -0
  7. package/dist/chunks/remove-shared-link-modal.js +56 -0
  8. package/dist/chunks/shared-link-access.js +65 -0
  9. package/dist/chunks/shared-link-permission.js +67 -0
  10. package/dist/chunks/shared-link-section.js +176 -0
  11. package/dist/chunks/shared-link-settings-modal.js +86 -0
  12. package/dist/chunks/shared-with-avatars.js +48 -0
  13. package/dist/chunks/shield-restriction-notice.js +97 -0
  14. package/dist/chunks/text-area-container.js +36 -0
  15. package/dist/chunks/unified-share-form-modal.js +66 -0
  16. package/dist/chunks/unified-share-form.js +23 -0
  17. package/dist/esm/index.js +2 -4
  18. package/dist/esm/lib/components/classification-status/classification-status.js +2 -80
  19. package/dist/esm/lib/components/classification-status/index.js +2 -4
  20. package/dist/esm/lib/components/classification-status/messages.js +10 -12
  21. package/dist/esm/lib/components/index.js +5 -10
  22. package/dist/esm/lib/components/remove-collaborator-modal/index.js +2 -4
  23. package/dist/esm/lib/components/remove-collaborator-modal/messages.js +26 -28
  24. package/dist/esm/lib/components/remove-collaborator-modal/remove-collaborator-modal.js +2 -84
  25. package/dist/esm/lib/components/remove-shared-link-modal/index.js +2 -4
  26. package/dist/esm/lib/components/remove-shared-link-modal/messages.js +26 -28
  27. package/dist/esm/lib/components/remove-shared-link-modal/remove-shared-link-modal.js +2 -72
  28. package/dist/esm/lib/components/shared-link-settings-modal/download-section.js +35 -61
  29. package/dist/esm/lib/components/shared-link-settings-modal/expiration-section.js +33 -50
  30. package/dist/esm/lib/components/shared-link-settings-modal/index.js +2 -4
  31. package/dist/esm/lib/components/shared-link-settings-modal/messages.js +138 -144
  32. package/dist/esm/lib/components/shared-link-settings-modal/password-section.js +32 -52
  33. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings-modal.js +2 -98
  34. package/dist/esm/lib/components/shared-link-settings-modal/shared-link-settings.js +97 -126
  35. package/dist/esm/lib/components/shared-link-settings-modal/vanity-section.js +33 -47
  36. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-role.js +2 -128
  37. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/collaboration-section.js +2 -202
  38. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/index.js +2 -4
  39. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/messages.js +134 -136
  40. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shared-with-avatars.js +2 -67
  41. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/shield-restriction-notice.js +2 -134
  42. package/dist/esm/lib/components/unified-share-form-modal/collaboration-section/text-area-container.js +2 -53
  43. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-avatar.js +48 -60
  44. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list-item.js +2 -86
  45. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/collaborator-list.js +2 -101
  46. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/index.js +2 -4
  47. package/dist/esm/lib/components/unified-share-form-modal/collaborator-list/messages.js +38 -40
  48. package/dist/esm/lib/components/unified-share-form-modal/index.js +2 -4
  49. package/dist/esm/lib/components/unified-share-form-modal/messages.js +46 -48
  50. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/index.js +2 -4
  51. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/messages.js +142 -144
  52. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-access.js +2 -102
  53. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-permission.js +2 -105
  54. package/dist/esm/lib/components/unified-share-form-modal/shared-link-section/shared-link-section.js +2 -191
  55. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form-modal.js +2 -85
  56. package/dist/esm/lib/components/unified-share-form-modal/unified-share-form.js +2 -29
  57. package/dist/esm/lib/constants.js +44 -28
  58. package/dist/esm/lib/contexts/index.js +4 -14
  59. package/dist/esm/lib/contexts/shared-link-settings-context.js +50 -59
  60. package/dist/esm/lib/contexts/unified-share-form-context.js +60 -57
  61. package/dist/esm/lib/contexts/unified-share-modal-context.js +65 -68
  62. package/dist/esm/lib/hooks/index.js +7 -14
  63. package/dist/esm/lib/hooks/use-access-levels.js +69 -93
  64. package/dist/esm/lib/hooks/use-collaboration-form.js +75 -95
  65. package/dist/esm/lib/hooks/use-form-validation.js +32 -43
  66. package/dist/esm/lib/hooks/use-link-settings-form.js +49 -64
  67. package/dist/esm/lib/hooks/use-permission-levels.js +33 -50
  68. package/dist/esm/lib/hooks/use-sharing-action.js +44 -59
  69. package/dist/esm/lib/messages.js +106 -108
  70. package/dist/esm/lib/unified-share-base.js +30 -40
  71. package/dist/esm/lib/unified-share-modal.js +41 -59
  72. package/dist/esm/lib/utils/collaborator.js +12 -27
  73. package/dist/esm/lib/utils/date.js +10 -14
  74. package/dist/esm/lib/utils/email.js +5 -7
  75. package/dist/esm/lib/utils/event.js +6 -13
  76. package/dist/esm/lib/utils/form.js +4 -14
  77. package/dist/esm/lib/utils/index.js +9 -34
  78. package/dist/esm/lib/utils/notification.js +19 -28
  79. package/dist/esm/lib/utils/permission.js +15 -22
  80. package/dist/esm/lib/utils/validation.js +2 -11
  81. package/dist/styles/classification-status.css +1 -1
  82. package/dist/styles/collaboration-role.css +1 -1
  83. package/dist/styles/collaboration-section.css +1 -1
  84. package/dist/styles/collaborator-list-item.css +1 -1
  85. package/dist/styles/collaborator-list.css +1 -1
  86. package/dist/styles/remove-collaborator-modal.css +1 -1
  87. package/dist/styles/shared-link-access.css +1 -1
  88. package/dist/styles/shared-link-section.css +1 -1
  89. package/dist/styles/shared-link-settings-modal.css +1 -1
  90. package/dist/styles/shared-with-avatars.css +1 -1
  91. package/dist/styles/shield-restriction-notice.css +1 -1
  92. package/dist/styles/text-area-container.css +1 -1
  93. package/dist/styles/unified-share-form-modal.css +1 -1
  94. package/dist/styles/unified-share-form.css +1 -1
  95. package/package.json +9 -9
@@ -1,146 +1,140 @@
1
1
  import { defineMessages as e } from "react-intl";
2
- const t = e({
3
- title: {
4
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.title",
5
- defaultMessage: "Shared Link Settings"
6
- },
7
- subtitleCompanyDownload: {
8
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyDownload",
9
- defaultMessage: "This content is available to anyone within your company with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}"
10
- },
11
- subtitleCompanyView: {
12
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyView",
13
- defaultMessage: "This content is available to anyone within your company with the link, and can be viewed. {learnSharedLinkSettingsLink}"
14
- },
15
- subtitleOpenDownload: {
16
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenDownload",
17
- defaultMessage: "This content is publicly available to anyone with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}"
18
- },
19
- subtitleOpenView: {
20
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenView",
21
- defaultMessage: "This content is publicly available to anyone with the link, and can be viewed. {learnSharedLinkSettingsLink}"
22
- },
23
- subtitleCollaborators: {
24
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCollaborators",
25
- defaultMessage: "This content is available to invited collaborators with the link. {learnSharedLinkSettingsLink}"
26
- },
27
- cancelButton: {
28
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton",
29
- defaultMessage: "Cancel"
30
- },
31
- closeButton: {
32
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton",
33
- defaultMessage: "Close"
34
- },
35
- loadingLabel: {
36
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.loadingLabel",
37
- defaultMessage: "Loading"
38
- },
39
- saveButton: {
40
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.saveButton",
41
- defaultMessage: "Save"
42
- },
43
- learnSharedLinkSettingsLink: {
44
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink",
45
- defaultMessage: "Learn more about shared link settings."
46
- },
47
- // Link Expiration settings
48
- linkExpirationCalendarAriaLabel: {
49
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationCalendarAriaLabel",
50
- defaultMessage: "Select an expiration date"
51
- },
52
- linkExpirationClearDatePickerAriaLabel: {
53
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationClearDatePickerAriaLabel",
54
- defaultMessage: "Clear date picker"
55
- },
56
- linkExpirationNextMonthAriaLabel: {
57
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationNextMonthAriaLabel",
58
- defaultMessage: "Switch to next month"
59
- },
60
- linkExpirationOpenCalendarDropdownAriaLabel: {
61
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationOpenCalendarDropdownAriaLabel",
62
- defaultMessage: "Open calendar"
63
- },
64
- linkExpirationPreviousMonthAriaLabel: {
65
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationPreviousMonthAriaLabel",
66
- defaultMessage: "Switch to previous month"
67
- },
68
- linkExpirationDatePickerLabel: {
69
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationDatePickerLabel",
70
- defaultMessage: "Expiration date"
71
- },
72
- linkExpirationToggleText: {
73
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationToggleText",
74
- defaultMessage: "Link expiration"
75
- },
76
- // Vanity Domain Settings
77
- vanityNameToggleText: {
78
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameToggleText",
79
- defaultMessage: "Publish content broadly with a custom, non-private URL"
80
- },
81
- warningNoticeIconAriaLabel: {
82
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.warningNoticeIconAriaLabel",
83
- defaultMessage: "Warning"
84
- },
85
- vanityDomainSettingsWarningText: {
86
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityDomainSettingsWarningText",
87
- defaultMessage: "Custom URLs should not be used when sharing sensitive content."
88
- },
89
- vanityNameInputLabel: {
90
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputLabel",
91
- defaultMessage: "Custom path"
92
- },
93
- vanityNameInputPlaceholder: {
94
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputPlaceholder",
95
- defaultMessage: "Enter a custom path (12 or more characters)"
96
- },
97
- // Download Settings
98
- downloadSettingsToggleText: {
99
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText",
100
- defaultMessage: "Allow users with the shared link to download this item"
101
- },
102
- directLinkLabel: {
103
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel",
104
- defaultMessage: "Direct link"
105
- },
106
- directLinkBlockedByMaliciousContent: {
107
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByMaliciousContent",
108
- defaultMessage: "Download for this content has been disabled due to a security policy."
109
- },
110
- directLinkBlockedByAccessPolicyWithClassification: {
111
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification",
112
- defaultMessage: "Download has been disabled for content due to the classification."
113
- },
114
- directLinkBlockedByAccessPolicyWithoutClassification: {
115
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithoutClassification",
116
- defaultMessage: "Download has been disabled for content without classification."
117
- },
118
- // Password Settings
119
- passwordToggleText: {
120
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordToggleText",
121
- defaultMessage: "Password protection"
122
- },
123
- passwordInputPlaceholder: {
124
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordInputPlaceholder",
125
- defaultMessage: "Enter a password"
126
- },
127
- passwordWarningText: {
128
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordWarningText",
129
- defaultMessage: "Passwords must include at least 8 characters, and must contain at least one upper case letter, number, or special character."
130
- },
131
- showPasswordAriaLabel: {
132
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.showPasswordAriaLabel",
133
- defaultMessage: "Show password"
134
- },
135
- hidePasswordAriaLabel: {
136
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel",
137
- defaultMessage: "Hide password"
138
- },
139
- inaccessibleSettingsNotice: {
140
- id: "groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice",
141
- defaultMessage: "Certain settings may not be available for this item due to permissions."
142
- }
2
+ var t = e({
3
+ title: {
4
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.title",
5
+ defaultMessage: "Shared Link Settings"
6
+ },
7
+ subtitleCompanyDownload: {
8
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyDownload",
9
+ defaultMessage: "This content is available to anyone within your company with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}"
10
+ },
11
+ subtitleCompanyView: {
12
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCompanyView",
13
+ defaultMessage: "This content is available to anyone within your company with the link, and can be viewed. {learnSharedLinkSettingsLink}"
14
+ },
15
+ subtitleOpenDownload: {
16
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenDownload",
17
+ defaultMessage: "This content is publicly available to anyone with the link, and can be viewed or downloaded. {learnSharedLinkSettingsLink}"
18
+ },
19
+ subtitleOpenView: {
20
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleOpenView",
21
+ defaultMessage: "This content is publicly available to anyone with the link, and can be viewed. {learnSharedLinkSettingsLink}"
22
+ },
23
+ subtitleCollaborators: {
24
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.subtitleCollaborators",
25
+ defaultMessage: "This content is available to invited collaborators with the link. {learnSharedLinkSettingsLink}"
26
+ },
27
+ cancelButton: {
28
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.cancelButton",
29
+ defaultMessage: "Cancel"
30
+ },
31
+ closeButton: {
32
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.closeButton",
33
+ defaultMessage: "Close"
34
+ },
35
+ loadingLabel: {
36
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.loadingLabel",
37
+ defaultMessage: "Loading"
38
+ },
39
+ saveButton: {
40
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.saveButton",
41
+ defaultMessage: "Save"
42
+ },
43
+ learnSharedLinkSettingsLink: {
44
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.learnSharedLinkSettingsLink",
45
+ defaultMessage: "Learn more about shared link settings."
46
+ },
47
+ linkExpirationCalendarAriaLabel: {
48
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationCalendarAriaLabel",
49
+ defaultMessage: "Select an expiration date"
50
+ },
51
+ linkExpirationClearDatePickerAriaLabel: {
52
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationClearDatePickerAriaLabel",
53
+ defaultMessage: "Clear date picker"
54
+ },
55
+ linkExpirationNextMonthAriaLabel: {
56
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationNextMonthAriaLabel",
57
+ defaultMessage: "Switch to next month"
58
+ },
59
+ linkExpirationOpenCalendarDropdownAriaLabel: {
60
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationOpenCalendarDropdownAriaLabel",
61
+ defaultMessage: "Open calendar"
62
+ },
63
+ linkExpirationPreviousMonthAriaLabel: {
64
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationPreviousMonthAriaLabel",
65
+ defaultMessage: "Switch to previous month"
66
+ },
67
+ linkExpirationDatePickerLabel: {
68
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationDatePickerLabel",
69
+ defaultMessage: "Expiration date"
70
+ },
71
+ linkExpirationToggleText: {
72
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.linkExpirationToggleText",
73
+ defaultMessage: "Link expiration"
74
+ },
75
+ vanityNameToggleText: {
76
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameToggleText",
77
+ defaultMessage: "Publish content broadly with a custom, non-private URL"
78
+ },
79
+ warningNoticeIconAriaLabel: {
80
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.warningNoticeIconAriaLabel",
81
+ defaultMessage: "Warning"
82
+ },
83
+ vanityDomainSettingsWarningText: {
84
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityDomainSettingsWarningText",
85
+ defaultMessage: "Custom URLs should not be used when sharing sensitive content."
86
+ },
87
+ vanityNameInputLabel: {
88
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputLabel",
89
+ defaultMessage: "Custom path"
90
+ },
91
+ vanityNameInputPlaceholder: {
92
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.vanityNameInputPlaceholder",
93
+ defaultMessage: "Enter a custom path (12 or more characters)"
94
+ },
95
+ downloadSettingsToggleText: {
96
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.downloadSettingsToggleText",
97
+ defaultMessage: "Allow users with the shared link to download this item"
98
+ },
99
+ directLinkLabel: {
100
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkLabel",
101
+ defaultMessage: "Direct link"
102
+ },
103
+ directLinkBlockedByMaliciousContent: {
104
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByMaliciousContent",
105
+ defaultMessage: "Download for this content has been disabled due to a security policy."
106
+ },
107
+ directLinkBlockedByAccessPolicyWithClassification: {
108
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithClassification",
109
+ defaultMessage: "Download has been disabled for content due to the classification."
110
+ },
111
+ directLinkBlockedByAccessPolicyWithoutClassification: {
112
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.directLinkBlockedByAccessPolicyWithoutClassification",
113
+ defaultMessage: "Download has been disabled for content without classification."
114
+ },
115
+ passwordToggleText: {
116
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordToggleText",
117
+ defaultMessage: "Password protection"
118
+ },
119
+ passwordInputPlaceholder: {
120
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordInputPlaceholder",
121
+ defaultMessage: "Enter a password"
122
+ },
123
+ passwordWarningText: {
124
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.passwordWarningText",
125
+ defaultMessage: "Passwords must include at least 8 characters, and must contain at least one upper case letter, number, or special character."
126
+ },
127
+ showPasswordAriaLabel: {
128
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.showPasswordAriaLabel",
129
+ defaultMessage: "Show password"
130
+ },
131
+ hidePasswordAriaLabel: {
132
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.hidePasswordAriaLabel",
133
+ defaultMessage: "Hide password"
134
+ },
135
+ inaccessibleSettingsNotice: {
136
+ id: "groupSharedFeatures.usm.sharedLinkSettingsModal.inaccessibleSettingsNotice",
137
+ defaultMessage: "Certain settings may not be available for this item due to permissions."
138
+ }
143
139
  });
144
- export {
145
- t as default
146
- };
140
+ export { t as default };
@@ -1,53 +1,33 @@
1
- import { useIntl as b } from "react-intl";
2
- import { Switch as g, InlineNotice as P, PasswordInput as f } from "@box/blueprint-web";
3
- import r from "./messages.js";
4
- import { jsxs as i, Fragment as l, jsx as o } from "react/jsx-runtime";
5
- const A = "••••••••";
6
- function T({
7
- canChange: a,
8
- error: n,
9
- isAvailable: d,
10
- isChecked: s,
11
- isDefaultChecked: w,
12
- isDisabled: t,
13
- onBlur: p,
14
- onChange: c,
15
- onFocus: m,
16
- onToggle: h,
17
- password: u
18
- }) {
19
- const {
20
- formatMessage: e
21
- } = b();
22
- return d ? /* @__PURE__ */ i(l, {
23
- children: [/* @__PURE__ */ o(g.Item, {
24
- checked: s,
25
- disabled: t || !a,
26
- label: e(r.passwordToggleText),
27
- onCheckedChange: h,
28
- value: "password-settings"
29
- }), s && /* @__PURE__ */ i(l, {
30
- children: [a && /* @__PURE__ */ o(P, {
31
- variant: "warning",
32
- variantIconAriaLabel: e(r.warningNoticeIconAriaLabel),
33
- children: e(r.passwordWarningText)
34
- }), /* @__PURE__ */ o(f, {
35
- autoComplete: "new-password",
36
- disabled: t || !a,
37
- error: n,
38
- hideLabel: !0,
39
- hidePasswordAriaLabel: e(r.hidePasswordAriaLabel),
40
- label: e(r.passwordToggleText),
41
- onBlur: p,
42
- onChange: c,
43
- onFocus: m,
44
- placeholder: w ? A : e(r.passwordInputPlaceholder),
45
- showPasswordAriaLabel: e(r.showPasswordAriaLabel),
46
- value: u
47
- })]
48
- })]
49
- }) : null;
1
+ import e from "./messages.js";
2
+ import { useIntl as t } from "react-intl";
3
+ import { InlineNotice as n, PasswordInput as r, Switch as i } from "@box/blueprint-web";
4
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ var c = "••••••••";
6
+ function l({ canChange: l, error: u, isAvailable: d, isChecked: f, isDefaultChecked: p, isDisabled: m, onBlur: h, onChange: g, onFocus: _, onToggle: v, password: y }) {
7
+ let { formatMessage: b } = t();
8
+ return d ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(i.Item, {
9
+ checked: f,
10
+ disabled: m || !l,
11
+ label: b(e.passwordToggleText),
12
+ onCheckedChange: v,
13
+ value: "password-settings"
14
+ }), f && /* @__PURE__ */ s(a, { children: [l && /* @__PURE__ */ o(n, {
15
+ variant: "warning",
16
+ variantIconAriaLabel: b(e.warningNoticeIconAriaLabel),
17
+ children: b(e.passwordWarningText)
18
+ }), /* @__PURE__ */ o(r, {
19
+ autoComplete: "new-password",
20
+ disabled: m || !l,
21
+ error: u,
22
+ hideLabel: !0,
23
+ hidePasswordAriaLabel: b(e.hidePasswordAriaLabel),
24
+ label: b(e.passwordToggleText),
25
+ onBlur: h,
26
+ onChange: g,
27
+ onFocus: _,
28
+ placeholder: p ? c : b(e.passwordInputPlaceholder),
29
+ showPasswordAriaLabel: b(e.showPasswordAriaLabel),
30
+ value: y
31
+ })] })] }) : null;
50
32
  }
51
- export {
52
- T as PasswordSection
53
- };
33
+ export { l as PasswordSection };
@@ -1,98 +1,2 @@
1
- import l from "clsx";
2
- import { useState as C, useEffect as F } from "react";
3
- import { useIntl as B } from "react-intl";
4
- import { Modal as i, LoadingIndicator as N, Divider as x } from "@box/blueprint-web";
5
- import { SharedLinkSettings as D } from "./shared-link-settings.js";
6
- import n from "./messages.js";
7
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
8
- import { ClassificationStatus as M } from "../classification-status/classification-status.js";
9
- import { useUnifiedShareModalContext as w } from "../../contexts/unified-share-modal-context.js";
10
- import { useSharedLinkSettingsContext as I } from "../../contexts/shared-link-settings-context.js";
11
- import '../../../../styles/shared-link-settings-modal.css';const P = "_content_54561_1", j = "_isFullscreen_54561_4", z = "_body_54561_13", A = "_title_54561_23", E = "_form_54561_43", H = "_isLoading_54561_50", R = "_loading_54561_54", U = "_divider_54561_62", t = {
12
- content: P,
13
- isFullscreen: j,
14
- body: z,
15
- title: A,
16
- form: E,
17
- isLoading: H,
18
- loading: R,
19
- divider: U
20
- };
21
- function Z({
22
- isOpen: a,
23
- onOpenChange: f
24
- }) {
25
- const {
26
- formatMessage: o
27
- } = B(), {
28
- eventService: h,
29
- isSubmitting: r,
30
- variant: S
31
- } = w(), {
32
- onSharedLinkSettingsClose: u,
33
- onSharedLinkSettingsLoad: d
34
- } = h, c = S === "desktop", {
35
- resetForm: g,
36
- setContainerRef: L,
37
- submitForm: b
38
- } = I(), [m, p] = C(!!d);
39
- F(() => {
40
- (async () => d && (a && await d(), p(!a)))();
41
- }, [a, d]);
42
- const _ = () => {
43
- r || (g(), u && u(), f(!1));
44
- }, v = async () => {
45
- await b() || (g(), f(!1));
46
- }, y = (k) => {
47
- k.preventDefault();
48
- };
49
- return /* @__PURE__ */ e(i, {
50
- onOpenChange: _,
51
- open: a,
52
- children: /* @__PURE__ */ s(i.Content, {
53
- ref: L,
54
- className: l(t.content, c && t.isFullscreen),
55
- onPointerDownOutside: y,
56
- size: "medium",
57
- children: [/* @__PURE__ */ s(i.Header, {
58
- children: [/* @__PURE__ */ e("div", {
59
- className: t.title,
60
- children: o(n.title)
61
- }), /* @__PURE__ */ e(M, {})]
62
- }), /* @__PURE__ */ s("div", {
63
- className: l(t.form),
64
- children: [m && /* @__PURE__ */ e("div", {
65
- className: t.loading,
66
- children: /* @__PURE__ */ e(N, {
67
- "aria-label": o(n.loadingLabel),
68
- size: "large"
69
- })
70
- }), /* @__PURE__ */ s(i.Body, {
71
- className: l(t.body, m && t.isLoading),
72
- children: [c && /* @__PURE__ */ e(x, {
73
- className: t.divider
74
- }), /* @__PURE__ */ e(D, {})]
75
- }), /* @__PURE__ */ s(i.Footer, {
76
- className: l(m && t.isLoading),
77
- children: [/* @__PURE__ */ e(i.Footer.SecondaryButton, {
78
- disabled: r,
79
- onClick: _,
80
- children: o(n.cancelButton)
81
- }), /* @__PURE__ */ e(i.Footer.PrimaryButton, {
82
- id: "usm-SharedLinkSettingsModal-primaryButton",
83
- loading: r,
84
- loadingAriaLabel: o(n.loadingLabel),
85
- onClick: v,
86
- children: o(n.saveButton)
87
- })]
88
- })]
89
- }), !c && /* @__PURE__ */ e(i.Close, {
90
- "aria-label": o(n.closeButton),
91
- disabled: r
92
- })]
93
- })
94
- });
95
- }
96
- export {
97
- Z as SharedLinkSettingsModal
98
- };
1
+ import { t as e } from "../../../../chunks/shared-link-settings-modal.js";
2
+ export { e as SharedLinkSettingsModal };