@pgcorp/ui-kit 0.8.0 → 0.9.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.
@@ -14,6 +14,28 @@
14
14
  color var(--s-motion-standard) ease;
15
15
  }
16
16
 
17
+ .s-interactive-surface:has(.s-interactive-surface__actions > *) {
18
+ container-type: inline-size;
19
+ }
20
+
21
+ .s-interactive-surface__layout {
22
+ @apply grid min-h-0 min-w-0 w-full items-center;
23
+ grid-template-columns: minmax(0, 1fr);
24
+ }
25
+
26
+ .s-interactive-surface:has(.s-interactive-surface__actions > *) .s-interactive-surface__layout {
27
+ grid-template-columns: minmax(0, 1fr) auto;
28
+ }
29
+
30
+ .s-interactive-surface__primary {
31
+ @apply relative flex min-h-0 min-w-0;
32
+ }
33
+
34
+ .s-interactive-surface__actions {
35
+ @apply flex min-w-0 shrink-0 items-center;
36
+ gap: var(--s-space-control-gap);
37
+ }
38
+
17
39
  .s-interactive-surface[data-appearance='plain'] {
18
40
  @apply border-transparent bg-transparent dark:border-transparent dark:bg-transparent;
19
41
  }
@@ -46,7 +68,9 @@
46
68
  pointer-events: none;
47
69
  }
48
70
 
49
- .s-interactive-surface[data-fill='container'] { @apply h-full w-full; }
71
+ .s-interactive-surface[data-fill='container'],
72
+ .s-interactive-surface[data-fill='container'] .s-interactive-surface__layout,
73
+ .s-interactive-surface[data-fill='container'] .s-interactive-surface__primary { @apply h-full w-full; }
50
74
  .s-interactive-surface[data-density='compact'] { @apply text-sm; }
51
75
  .s-interactive-surface[data-density='comfortable'] { @apply text-base; }
52
76
  .s-interactive-surface[data-padding='none'] { @apply p-0; }
@@ -60,9 +84,31 @@
60
84
  .s-interactive-surface[data-s-tone='danger'] { @apply border-danger-200 bg-danger-50 dark:border-danger-800 dark:bg-danger-950; }
61
85
  .s-interactive-surface[data-selected='true'] { @apply border-primary-400 bg-primary-50 dark:border-primary-600 dark:bg-primary-950; }
62
86
  .s-interactive-surface[data-pressed='true'] { @apply border-primary-500 bg-primary-100 dark:border-primary-500 dark:bg-primary-950/70; }
63
- .s-interactive-surface[data-disabled='true'] { @apply cursor-not-allowed opacity-60; }
64
- .s-interactive-surface[data-content-align='start'] { @apply justify-start text-left; }
65
- .s-interactive-surface[data-content-align='center'] { @apply justify-center text-center; }
87
+ .s-interactive-surface[data-disabled='true'] { @apply cursor-not-allowed; }
88
+ .s-interactive-surface[data-disabled='true']:not(:has(.s-interactive-surface__actions > *)),
89
+ .s-interactive-surface[data-disabled='true']:has(.s-interactive-surface__actions > *) .s-interactive-surface__primary {
90
+ @apply opacity-60;
91
+ }
92
+ .s-interactive-surface[data-content-align='start'] .s-interactive-surface__content { @apply justify-start text-left; }
93
+ .s-interactive-surface[data-content-align='center'] .s-interactive-surface__content { @apply justify-center text-center; }
94
+
95
+ .s-interactive-surface[data-actions-layout='stacked']:has(.s-interactive-surface__actions > *) .s-interactive-surface__layout {
96
+ grid-template-columns: minmax(0, 1fr);
97
+ }
98
+
99
+ .s-interactive-surface[data-actions-layout='stacked'] .s-interactive-surface__actions {
100
+ @apply w-full;
101
+ }
102
+
103
+ @container (max-width: 32rem) {
104
+ .s-interactive-surface[data-actions-layout='responsive'] .s-interactive-surface__layout {
105
+ grid-template-columns: minmax(0, 1fr);
106
+ }
107
+
108
+ .s-interactive-surface[data-actions-layout='responsive'] .s-interactive-surface__actions {
109
+ @apply w-full;
110
+ }
111
+ }
66
112
 
67
113
  .s-interactive-surface[data-mode='action']:not([data-disabled='true']),
68
114
  .s-interactive-surface[data-mode='link']:not([data-disabled='true']) {
@@ -21,6 +21,7 @@ export type InteractiveSurfacePadding = 'none' | 'sm' | 'md'
21
21
  export type InteractiveSurfaceRadius = 'md' | 'lg' | 'xl'
22
22
  export type InteractiveSurfaceFill = 'content' | 'container'
23
23
  export type InteractiveSurfaceAppearance = 'card' | 'plain' | 'bare'
24
+ export type InteractiveSurfaceActionsLayout = 'responsive' | 'inline' | 'stacked'
24
25
 
25
26
  /**
26
27
  * Единственный semantic-контракт поверхности: passive, action или ровно одна link-target.
@@ -60,6 +61,7 @@ export interface Props {
60
61
  radius?: InteractiveSurfaceRadius
61
62
  fill?: InteractiveSurfaceFill
62
63
  appearance?: InteractiveSurfaceAppearance
64
+ actionsLayout?: InteractiveSurfaceActionsLayout
63
65
  contentAlign?: 'start' | 'center'
64
66
  /** Полный binding явного STooltip trigger, направляемый на activation owner. / Complete explicit STooltip trigger binding routed to the activation owner. */
65
67
  tooltipTrigger?: STooltipTriggerBinding
@@ -73,6 +75,7 @@ const props = withDefaults(defineProps<Props>(), {
73
75
  radius: 'lg',
74
76
  fill: 'content',
75
77
  appearance: 'card',
78
+ actionsLayout: 'inline',
76
79
  contentAlign: 'start',
77
80
  tooltipTrigger: undefined,
78
81
  })
@@ -80,9 +83,11 @@ const props = withDefaults(defineProps<Props>(), {
80
83
  const emit = defineEmits<{
81
84
  activate: [event: MouseEvent]
82
85
  }>()
83
- defineSlots<{
86
+ const slots = defineSlots<{
84
87
  /** Пассивное flow-содержимое поверхности. / Passive flow content of the surface. */
85
88
  default?: () => VNodeChild
89
+ /** Sibling controls inside the same visual chrome and outside the primary activation owner. */
90
+ actions?: () => VNodeChild
86
91
  }>()
87
92
 
88
93
  const ownedAttrs = useOwnedAttrs({ component: 'SInteractiveSurface', owner: 'interactive surface owner' })
@@ -297,40 +302,49 @@ function activateAction(event: MouseEvent): void {
297
302
  :data-radius="radius"
298
303
  :data-fill="fill"
299
304
  :data-appearance="appearance"
305
+ :data-actions-layout="actionsLayout"
306
+ :data-has-actions="Boolean(slots.actions) || undefined"
300
307
  :data-selected="selected || undefined"
301
308
  :data-pressed="surfacePressed"
302
309
  :data-disabled="surfaceDisabled || undefined"
303
310
  :data-content-align="contentAlign"
304
311
  >
305
- <button
306
- v-if="surfaceMode === 'action'"
307
- v-bind="activationBindings()"
308
- class="s-interactive-surface__activation"
309
- type="button"
310
- :disabled="surfaceDisabled"
311
- :aria-label="resolvedAccessibleLabel"
312
- :aria-pressed="surfacePressed"
313
- @click="activateAction"
314
- >
315
- <span class="s-interactive-surface__accessible-label">{{ resolvedAccessibleLabel }}</span>
316
- </button>
317
- <component
318
- v-else-if="surfaceMode === 'link'"
319
- :is="linkComponent"
320
- v-bind="linkBindings()"
321
- class="s-interactive-surface__activation"
322
- :aria-label="resolvedAccessibleLabel"
323
- :aria-current="selected ? 'page' : undefined"
324
- :aria-disabled="surfaceDisabled || undefined"
325
- :tabindex="surfaceDisabled ? -1 : undefined"
326
- @click="activateLink"
327
- >
328
- <span class="s-interactive-surface__accessible-label">{{ resolvedAccessibleLabel }}</span>
329
- </component>
330
- <div class="s-interactive-surface__content" data-passive-content="">
331
- <PassiveContentBoundary :contract="passiveContentContract">
332
- <slot />
333
- </PassiveContentBoundary>
312
+ <div class="s-interactive-surface__layout">
313
+ <div class="s-interactive-surface__primary">
314
+ <button
315
+ v-if="surfaceMode === 'action'"
316
+ v-bind="activationBindings()"
317
+ class="s-interactive-surface__activation"
318
+ type="button"
319
+ :disabled="surfaceDisabled"
320
+ :aria-label="resolvedAccessibleLabel"
321
+ :aria-pressed="surfacePressed"
322
+ @click="activateAction"
323
+ >
324
+ <span class="s-interactive-surface__accessible-label">{{ resolvedAccessibleLabel }}</span>
325
+ </button>
326
+ <component
327
+ v-else-if="surfaceMode === 'link'"
328
+ :is="linkComponent"
329
+ v-bind="linkBindings()"
330
+ class="s-interactive-surface__activation"
331
+ :aria-label="resolvedAccessibleLabel"
332
+ :aria-current="selected ? 'page' : undefined"
333
+ :aria-disabled="surfaceDisabled || undefined"
334
+ :tabindex="surfaceDisabled ? -1 : undefined"
335
+ @click="activateLink"
336
+ >
337
+ <span class="s-interactive-surface__accessible-label">{{ resolvedAccessibleLabel }}</span>
338
+ </component>
339
+ <div class="s-interactive-surface__content" data-passive-content="">
340
+ <PassiveContentBoundary :contract="passiveContentContract">
341
+ <slot />
342
+ </PassiveContentBoundary>
343
+ </div>
344
+ </div>
345
+ <div v-if="$slots.actions" class="s-interactive-surface__actions">
346
+ <slot name="actions" />
347
+ </div>
334
348
  </div>
335
349
  </div>
336
350
  </template>
@@ -0,0 +1,13 @@
1
+ export type {
2
+ Props as STextareaProps,
3
+ STextareaAppearance,
4
+ STextareaAutocomplete,
5
+ STextareaSuggestionPopupRole,
6
+ STextareaSuggestions,
7
+ STextareaReplaceOptions,
8
+ STextareaResizeContract,
9
+ STextareaSelection,
10
+ STextareaSelectionDirection,
11
+ STextareaSize,
12
+ STextareaState,
13
+ } from './STextarea.vue'