@konce-pt/styles 0.16.0 → 0.17.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 (3) hide show
  1. package/README.md +21 -5
  2. package/components.css +186 -10
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Koncept UI - Base Styles
6
6
 
7
- **Base CSS for Koncept UI - reset, cascade layers and neutral light/dark theme.**
7
+ **Base CSS for Koncept UI - reset, cascade layers and light/dark `color-scheme` switching.**
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/@konce-pt/styles?color=%233b82f6&label=npm)](https://www.npmjs.com/package/@konce-pt/styles)
10
10
  [![minzipped size](https://img.shields.io/bundlephobia/minzip/@konce-pt/styles)](https://bundlephobia.com/package/@konce-pt/styles)
@@ -14,7 +14,9 @@
14
14
 
15
15
  ---
16
16
 
17
- The base stylesheet for [Koncept UI](https://www.npmjs.com/package/@konce-pt/angular): a modern reset, typography, and CSS **`@layer`** ordering (`kpt.reset, kpt.base, kpt.components, kpt.utilities`) so consumers can override styles without specificity wars. Built on top of [`@konce-pt/tokens`](https://www.npmjs.com/package/@konce-pt/tokens).
17
+ The base stylesheet for [Koncept UI](https://www.npmjs.com/package/@konce-pt/angular): a modern reset, typography, and CSS **`@layer`** ordering (`kpt.reset, kpt.base, kpt.components, kpt.utilities`) so consumers can override styles without specificity wars. Built on top of [`@konce-pt/tokens`](https://www.npmjs.com/package/@konce-pt/tokens) - the colours of the light and dark theme come from there; this sheet switches `color-scheme` under `[data-theme="dark"]` and paints `body` from the tokens.
18
+
19
+ It also ships a `:focus-visible` ring, token-driven scrollbars (`--kpt-scrollbar-*`), `.kpt-tooltip` and `.kpt-rich-content` (in `kpt.components`) and the utilities `.kpt-elevation-1..4` and `.kpt-visually-hidden` (in `kpt.utilities`).
18
20
 
19
21
  ## Installation
20
22
 
@@ -45,12 +47,23 @@ import '@konce-pt/tokens/css/dark';
45
47
  import '@konce-pt/styles';
46
48
  ```
47
49
 
48
- Or compose the SCSS source into your own build:
50
+ Or compose the SCSS source into your own build (`pkg:` resolves the package `exports`; the Sass CLI
51
+ needs `--pkg-importer=node`):
49
52
 
50
53
  ```scss
51
- @use '@konce-pt/styles/scss';
54
+ @use 'pkg:@konce-pt/styles/scss';
52
55
  ```
53
56
 
57
+ **Component styles for the React port** - `@konce-pt/react` renders the same `kpt-*` classes and
58
+ needs their stylesheet:
59
+
60
+ ```ts
61
+ import '@konce-pt/styles/components';
62
+ ```
63
+
64
+ `components.css` is generated from the Angular component SCSS. The Angular package injects its
65
+ component styles itself and does not need it.
66
+
54
67
  ## Layout
55
68
 
56
69
  Layout is a separate, optional package: [`@konce-pt/grid`](https://www.npmjs.com/package/@konce-pt/grid)
@@ -76,7 +89,7 @@ MIT © konce.pt
76
89
 
77
90
  ## Wersja polska
78
91
 
79
- Bazowy arkusz stylów [Koncept UI](https://www.npmjs.com/package/@konce-pt/angular): nowoczesny reset, typografia i warstwy CSS **`@layer`** (`kpt.reset, kpt.base, kpt.components, kpt.utilities`) - łatwe nadpisywanie bez wojen specyficzności. Bazuje na [`@konce-pt/tokens`](https://www.npmjs.com/package/@konce-pt/tokens); ładuj **po** tokenach.
92
+ Bazowy arkusz stylów [Koncept UI](https://www.npmjs.com/package/@konce-pt/angular): nowoczesny reset, typografia i warstwy CSS **`@layer`** (`kpt.reset, kpt.base, kpt.components, kpt.utilities`) - łatwe nadpisywanie bez wojen specyficzności. Bazuje na [`@konce-pt/tokens`](https://www.npmjs.com/package/@konce-pt/tokens) (stamtąd pochodzą kolory motywu jasnego i ciemnego; ten arkusz przełącza `color-scheme` pod `[data-theme="dark"]`); ładuj **po** tokenach. W pakiecie są też pierścień `:focus-visible`, paski przewijania z tokenów `--kpt-scrollbar-*`, `.kpt-tooltip`, `.kpt-rich-content` oraz utility `.kpt-elevation-1..4` i `.kpt-visually-hidden`.
80
93
 
81
94
  **Angular CLI** - `angular.json -> styles[]` (najpierw tokeny, potem ten plik, na końcu Twój `src/styles.scss`):
82
95
 
@@ -91,6 +104,9 @@ Bazowy arkusz stylów [Koncept UI](https://www.npmjs.com/package/@konce-pt/angul
91
104
 
92
105
  **Vite/webpack** - `import '@konce-pt/tokens/css'; import '@konce-pt/tokens/css/dark'; import '@konce-pt/styles';`
93
106
 
107
+ **Style komponentów dla portu React** - `import '@konce-pt/styles/components';` (`components.css`
108
+ generowany z SCSS komponentów Angulara; paczka Angulara wstrzykuje swoje style sama i go nie potrzebuje).
109
+
94
110
  **Układ** to osobna, opcjonalna paczka [`@konce-pt/grid`](https://www.npmjs.com/package/@konce-pt/grid)
95
111
  (siatka mobile-first, flexbox, gap, order) - ładuj ją zaraz po tym arkuszu. Pisze do tej samej
96
112
  warstwy `kpt.utilities` i powtarza deklarację kolejności warstw, więc działa też bez tej paczki.
package/components.css CHANGED
@@ -1858,6 +1858,7 @@
1858
1858
  }
1859
1859
  .kpt-carousel__viewport {
1860
1860
  overflow: hidden;
1861
+ contain: inline-size;
1861
1862
  }
1862
1863
  .kpt-carousel__track {
1863
1864
  display: flex;
@@ -4286,17 +4287,32 @@
4286
4287
  display: flex;
4287
4288
  align-items: center;
4288
4289
  justify-content: center;
4290
+ aspect-ratio: var(--kpt-galleria-aspect-ratio, 16/9);
4289
4291
  background: var(--kpt-color-muted);
4290
4292
  border-radius: var(--kpt-radius-md, 0.5rem);
4291
4293
  overflow: hidden;
4294
+ isolation: isolate;
4292
4295
  }
4293
4296
  .kpt-galleria__image {
4294
- max-width: 100%;
4295
- max-height: 20rem;
4297
+ position: relative;
4298
+ z-index: 1;
4296
4299
  display: block;
4300
+ width: 100%;
4301
+ height: 100%;
4302
+ object-fit: var(--kpt-galleria-fit, cover);
4303
+ }
4304
+ .kpt-galleria__ghost {
4305
+ position: absolute;
4306
+ inset: 0;
4307
+ z-index: 0;
4308
+ width: 100%;
4309
+ height: 100%;
4310
+ object-fit: var(--kpt-galleria-fit, cover);
4311
+ pointer-events: none;
4297
4312
  }
4298
4313
  .kpt-galleria__nav {
4299
4314
  position: absolute;
4315
+ z-index: 2;
4300
4316
  top: 50%;
4301
4317
  transform: translateY(-50%);
4302
4318
  display: inline-flex;
@@ -4324,12 +4340,41 @@
4324
4340
  opacity: 0.4;
4325
4341
  cursor: default;
4326
4342
  }
4343
+ .kpt-galleria__strip {
4344
+ --_fade-start: 0px;
4345
+ --_fade-end: 0px;
4346
+ position: relative;
4347
+ margin-top: var(--kpt-space-2, 0.5rem);
4348
+ }
4349
+ .kpt-galleria__strip[data-scroll-start] {
4350
+ --_fade-start: 2.5rem;
4351
+ }
4352
+ .kpt-galleria__strip[data-scroll-end] {
4353
+ --_fade-end: 2.5rem;
4354
+ }
4327
4355
  .kpt-galleria__thumbs {
4328
4356
  display: flex;
4329
4357
  gap: var(--kpt-space-2, 0.5rem);
4330
- margin-top: var(--kpt-space-2, 0.5rem);
4331
4358
  overflow-x: auto;
4332
- padding-bottom: var(--kpt-space-1, 0.25rem);
4359
+ contain: inline-size;
4360
+ padding-block: var(--kpt-space-1, 0.25rem);
4361
+ scrollbar-width: none;
4362
+ overscroll-behavior-x: contain;
4363
+ cursor: grab;
4364
+ mask-image: linear-gradient(to right, transparent, var(--kpt-color-text) var(--_fade-start), var(--kpt-color-text) calc(100% - var(--_fade-end)), transparent);
4365
+ }
4366
+ .kpt-galleria__thumbs::-webkit-scrollbar {
4367
+ display: none;
4368
+ }
4369
+ .kpt-galleria__thumbs.is-dragging {
4370
+ cursor: grabbing;
4371
+ user-select: none;
4372
+ }
4373
+ .kpt-galleria__thumbs.is-dragging .kpt-galleria__thumb {
4374
+ pointer-events: none;
4375
+ }
4376
+ .kpt-galleria:dir(rtl) .kpt-galleria__thumbs {
4377
+ mask-image: linear-gradient(to left, transparent, var(--kpt-color-text) var(--_fade-start), var(--kpt-color-text) calc(100% - var(--_fade-end)), transparent);
4333
4378
  }
4334
4379
  .kpt-galleria__thumb {
4335
4380
  flex: none;
@@ -4349,6 +4394,7 @@
4349
4394
  height: 100%;
4350
4395
  object-fit: cover;
4351
4396
  display: block;
4397
+ -webkit-user-drag: none;
4352
4398
  }
4353
4399
  .kpt-galleria__thumb:hover {
4354
4400
  opacity: 1;
@@ -4357,9 +4403,51 @@
4357
4403
  opacity: 1;
4358
4404
  border-color: var(--kpt-color-primary);
4359
4405
  }
4360
- .kpt-galleria:dir(rtl) .kpt-galleria__nav .kpt-icon-host {
4406
+ .kpt-galleria__scroll {
4407
+ position: absolute;
4408
+ z-index: 1;
4409
+ top: 50%;
4410
+ display: inline-flex;
4411
+ align-items: center;
4412
+ justify-content: center;
4413
+ width: 1.75rem;
4414
+ height: 1.75rem;
4415
+ padding: 0;
4416
+ border: 0;
4417
+ border-radius: 999px;
4418
+ background: var(--kpt-color-surface);
4419
+ color: var(--kpt-color-on-surface);
4420
+ box-shadow: var(--kpt-elevation-2);
4421
+ cursor: pointer;
4422
+ opacity: 0;
4423
+ pointer-events: none;
4424
+ translate: 0 -50%;
4425
+ scale: 0.7;
4426
+ transition: opacity var(--kpt-motion-duration-base, 200ms) var(--kpt-motion-easing-standard), scale var(--kpt-motion-duration-base, 200ms) var(--kpt-motion-easing-standard);
4427
+ }
4428
+ .kpt-galleria__scroll--back {
4429
+ inset-inline-start: calc(var(--kpt-space-1, 0.25rem) * -1);
4430
+ }
4431
+ .kpt-galleria__scroll--forward {
4432
+ inset-inline-end: calc(var(--kpt-space-1, 0.25rem) * -1);
4433
+ }
4434
+ .kpt-galleria__scroll:hover {
4435
+ background: var(--kpt-color-muted);
4436
+ }
4437
+ .kpt-galleria__strip[data-scroll-start] .kpt-galleria__scroll--back,
4438
+ .kpt-galleria__strip[data-scroll-end] .kpt-galleria__scroll--forward {
4439
+ opacity: 1;
4440
+ pointer-events: auto;
4441
+ scale: 1;
4442
+ }
4443
+ .kpt-galleria:dir(rtl) :is(.kpt-galleria__nav, .kpt-galleria__scroll) .kpt-icon-host {
4361
4444
  transform: scaleX(-1);
4362
4445
  }
4446
+ @media (prefers-reduced-motion: reduce) {
4447
+ .kpt-galleria__scroll {
4448
+ transition: none;
4449
+ }
4450
+ }
4363
4451
  .kpt-galleria__live {
4364
4452
  position: absolute;
4365
4453
  width: 1px;
@@ -4563,8 +4651,8 @@
4563
4651
  background: var(--kpt-color-overlay-scrim);
4564
4652
  }
4565
4653
  .kpt-image__full {
4566
- max-width: 90vw;
4567
- max-height: 90vh;
4654
+ max-width: var(--kpt-image-preview-max-width, 90vw);
4655
+ max-height: var(--kpt-image-preview-max-height, 80vh);
4568
4656
  border-radius: var(--kpt-radius-md, 0.5rem);
4569
4657
  cursor: default;
4570
4658
  }
@@ -4646,6 +4734,57 @@
4646
4734
  inset-inline-end: var(--kpt-space-1, 0.25rem);
4647
4735
  gap: var(--kpt-space-1, 0.25rem);
4648
4736
  }
4737
+ .kpt-input__field::-webkit-search-cancel-button {
4738
+ appearance: none;
4739
+ display: none;
4740
+ }
4741
+ .kpt-input-host[data-clear] {
4742
+ position: relative;
4743
+ --_clear-end: var(--kpt-space-1, 0.25rem);
4744
+ }
4745
+ .kpt-input-host[data-clear][data-speech] {
4746
+ --_clear-end: 2.25rem;
4747
+ }
4748
+ .kpt-input-host[data-clear][data-speech=listening] {
4749
+ --_clear-end: 4.25rem;
4750
+ }
4751
+ .kpt-input-host[data-clear] .kpt-input__field {
4752
+ padding-inline-end: calc(var(--_clear-end) + 2rem);
4753
+ transition-property: border-color, box-shadow, padding-inline-end;
4754
+ }
4755
+ .kpt-input__clear {
4756
+ position: absolute;
4757
+ inset-block: 0;
4758
+ inset-inline-end: var(--_clear-end);
4759
+ display: inline-flex;
4760
+ align-items: center;
4761
+ justify-content: center;
4762
+ width: 1.75rem;
4763
+ height: 1.75rem;
4764
+ margin-block: auto;
4765
+ padding: 0;
4766
+ border: 0;
4767
+ border-radius: var(--kpt-radius-full, 9999px);
4768
+ background: transparent;
4769
+ color: var(--kpt-form-field-placeholder);
4770
+ font-size: 1rem;
4771
+ cursor: pointer;
4772
+ transition: color var(--kpt-motion-duration-fast, 120ms) var(--kpt-motion-easing-standard), background-color var(--kpt-motion-duration-fast, 120ms) var(--kpt-motion-easing-standard), scale calc(var(--_press-t, 0.45s) * var(--kpt-motion-scale, 1)) var(--_press-e, linear(0, 0.0884, 0.2807, 0.4973, 0.692, 0.8441, 0.9493, 1.013, 1.0446, 1.0542, 1.0506, 1.0406, 1.0288, 1.018, 1.0094, 1.0034, 0.9996, 0.9977, 0.9971, 0.9972, 0.9977, 0.9984, 0.999, 0.9994, 0.9998, 1, 1.0001, 1.0002, 1.0002, 1.0001, 1));
4773
+ }
4774
+ .kpt-input__clear:active:not(:disabled):not([aria-disabled=true]) {
4775
+ --_press-t: 0.08s;
4776
+ --_press-e: ease-out;
4777
+ scale: 0.9;
4778
+ }
4779
+ @media (prefers-reduced-motion: reduce) {
4780
+ .kpt-input__clear:active:not(:disabled):not([aria-disabled=true]) {
4781
+ scale: none;
4782
+ }
4783
+ }
4784
+ .kpt-input__clear:hover {
4785
+ color: var(--kpt-form-field-text);
4786
+ background: var(--kpt-color-surface-variant);
4787
+ }
4649
4788
  }
4650
4789
 
4651
4790
  /* src/lib/input-mask/input-mask.component.scss */
@@ -5978,7 +6117,8 @@
5978
6117
  cursor: pointer;
5979
6118
  }
5980
6119
  .kpt-popover__panel {
5981
- max-width: 20rem;
6120
+ box-sizing: border-box;
6121
+ max-width: min(var(--_max-width, 20rem), 100vw - 16px);
5982
6122
  padding: var(--kpt-space-4, 1rem);
5983
6123
  background: var(--kpt-color-surface-raised);
5984
6124
  border: var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);
@@ -8303,13 +8443,23 @@
8303
8443
  display: block;
8304
8444
  }
8305
8445
  .kpt-tabs__header {
8306
- position: relative;
8307
8446
  display: flex;
8308
8447
  gap: 0.25rem;
8309
8448
  border-bottom: var(--kpt-border-width-thin, 1px) solid var(--kpt-color-border);
8310
8449
  }
8450
+ .kpt-tabs__list,
8451
+ .kpt-tabs__links {
8452
+ display: flex;
8453
+ gap: 0.25rem;
8454
+ }
8455
+ .kpt-tabs__list {
8456
+ position: relative;
8457
+ }
8311
8458
  .kpt-tabs__tab {
8312
8459
  appearance: none;
8460
+ display: inline-flex;
8461
+ align-items: center;
8462
+ gap: var(--kpt-space-2, 0.5rem);
8313
8463
  border: 0;
8314
8464
  background: none;
8315
8465
  padding: 0.65rem 1rem;
@@ -8320,7 +8470,7 @@
8320
8470
  cursor: pointer;
8321
8471
  transition: color var(--kpt-motion-duration-fast, 120ms) var(--kpt-motion-easing-standard);
8322
8472
  }
8323
- .kpt-tabs__tab:hover:not(:disabled):not(.is-active) {
8473
+ .kpt-tabs__tab:hover:not(:disabled, [aria-disabled=true], .is-active) {
8324
8474
  color: var(--kpt-color-on-surface);
8325
8475
  }
8326
8476
  .kpt-tabs__tab.is-active {
@@ -8330,6 +8480,32 @@
8330
8480
  opacity: 0.45;
8331
8481
  cursor: not-allowed;
8332
8482
  }
8483
+ .kpt-tabs__link {
8484
+ text-decoration: none;
8485
+ }
8486
+ .kpt-tabs__link[aria-disabled=true] {
8487
+ opacity: 0.45;
8488
+ cursor: not-allowed;
8489
+ }
8490
+ .kpt-tabs__icon {
8491
+ font-size: 1.125em;
8492
+ color: var(--_icon-color, currentColor);
8493
+ }
8494
+ .kpt-tabs__icon[data-color=primary] {
8495
+ --_icon-color: var(--kpt-color-primary);
8496
+ }
8497
+ .kpt-tabs__icon[data-color=success] {
8498
+ --_icon-color: var(--kpt-color-success);
8499
+ }
8500
+ .kpt-tabs__icon[data-color=warning] {
8501
+ --_icon-color: var(--kpt-color-warning);
8502
+ }
8503
+ .kpt-tabs__icon[data-color=danger] {
8504
+ --_icon-color: var(--kpt-color-danger);
8505
+ }
8506
+ .kpt-tabs__icon[data-color=info] {
8507
+ --_icon-color: var(--kpt-color-info);
8508
+ }
8333
8509
  .kpt-tabs__ink {
8334
8510
  position: absolute;
8335
8511
  bottom: -1px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konce-pt/styles",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Base CSS for Koncept UI - reset, cascade @layer ordering and neutral light/dark theme (SCSS source).",
5
5
  "license": "MIT",
6
6
  "author": "konce.pt",
@@ -52,7 +52,7 @@
52
52
  "src"
53
53
  ],
54
54
  "peerDependencies": {
55
- "@konce-pt/tokens": "0.16.0"
55
+ "@konce-pt/tokens": "0.17.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "sass": "^1.77.0"