@pontive/pontkit-core 1.48.0 → 1.49.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.
package/dist/styles.css CHANGED
@@ -818,6 +818,8 @@
818
818
  --pont-sem-color-ring-focus: var(--pont-sem-color-base-ring);
819
819
  --pont-sem-color-ring-invalid: var(--pont-sem-color-destructive-ring);
820
820
 
821
+ --pont-sem-color-ring-offset: var(--pont-sem-color-bg);
822
+
821
823
  --pont-sem-color-input: var(--pont-ref-color-base-200);
822
824
 
823
825
  --pont-sem-color-control: var(--pont-sem-color-bg);
@@ -1105,6 +1107,8 @@
1105
1107
  --pont-sem-color-ring-focus: var(--pont-sem-color-base-ring);
1106
1108
  --pont-sem-color-ring-invalid: var(--pont-sem-color-destructive-ring);
1107
1109
 
1110
+ --pont-sem-color-ring-offset: var(--pont-sem-color-bg);
1111
+
1108
1112
  --pont-sem-color-input: color-mix(
1109
1113
  in oklab,
1110
1114
  var(--pont-ref-color-white) 15%,
@@ -2042,7 +2046,7 @@
2042
2046
 
2043
2047
  :root {
2044
2048
  --pont-sem-shadow-ring-offset: 0 0 0
2045
- var(--pont-sem-shadow-ring-offset-width) var(--pont-sem-color-bg);
2049
+ var(--pont-sem-shadow-ring-offset-width) var(--pont-sem-color-ring-offset);
2046
2050
  }
2047
2051
  }
2048
2052
 
@@ -2831,48 +2835,147 @@
2831
2835
 
2832
2836
  /* ../primitives/label/label.css */
2833
2837
  /*
2834
- * Label. shadcn (Base UI, Vega):
2835
- * "flex items-center select-none group-data-[disabled=true]:pointer-events-none
2836
- * peer-disabled:cursor-not-allowed" + .cn-label
2837
- * "gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50
2838
- * peer-disabled:opacity-50"
2838
+ * ===========================================================================
2839
+ * LABEL STYLES
2840
+ * ===========================================================================
2841
+ *
2842
+ * shadcn/ui Base UI x Vega:
2843
+ * flex items-center gap-2 text-sm leading-none font-medium select-none
2844
+ * group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50
2845
+ * peer-disabled:cursor-not-allowed peer-disabled:opacity-50
2839
2846
  *
2840
2847
  * Tokens (docs/11-tokens.md): `--pont-label-*`, resolved on the label. The
2841
- * colour is inherited (an invalid Field turns its labels destructive).
2848
+ * text colour defaults to currentColor, so it is inherited. An invalid Field
2849
+ * re-points `--_pont-label-color-fg` at its invalid colour (field.css), so its
2850
+ * labels turn destructive even when a theme sets `--pont-label-color-fg`.
2851
+ */
2852
+
2853
+ /*
2854
+ * ---------------------------------------------------------------------------
2855
+ * TOKENS
2856
+ * ---------------------------------------------------------------------------
2842
2857
  */
2858
+
2843
2859
  @layer pont.primitives {
2844
2860
  [data-pont-label] {
2845
- /** @token Text size */
2846
- --_pont-label-font-size: var(--pont-label-font-size, var(--pont-ref-typography-size-sm));
2847
- /** @token Weight */
2848
- --_pont-label-font-weight: var(--pont-label-font-weight, var(--pont-ref-typography-weight-medium));
2861
+ /** @token Align items */
2862
+ --_pont-label-items: var(
2863
+ --pont-label-items,
2864
+ var(--pont-ref-layout-items-center)
2865
+ );
2866
+ /** @token Justify content */
2867
+ --_pont-label-justify: var(
2868
+ --pont-label-justify,
2869
+ var(--pont-sem-layout-justify)
2870
+ );
2871
+
2872
+ /** @token Gap */
2873
+ --_pont-label-gap: var(
2874
+ --pont-label-gap,
2875
+ calc(var(--pont-ref-dimension) * 2)
2876
+ );
2877
+ /** @token Horizontal gap */
2878
+ --_pont-label-gap-x: var(--pont-label-gap-x, var(--_pont-label-gap));
2879
+ /** @token Vertical gap */
2880
+ --_pont-label-gap-y: var(--pont-label-gap-y, var(--_pont-label-gap));
2881
+
2882
+ /** @token Font family */
2883
+ --_pont-label-font-family: var(
2884
+ --pont-label-font-family,
2885
+ var(--pont-sem-typography-font-body)
2886
+ );
2887
+ /** @token Font size */
2888
+ --_pont-label-font-size: var(
2889
+ --pont-label-font-size,
2890
+ var(--pont-ref-typography-size-sm)
2891
+ );
2892
+ /** @token Font weight */
2893
+ --_pont-label-font-weight: var(
2894
+ --pont-label-font-weight,
2895
+ var(--pont-ref-typography-weight-medium)
2896
+ );
2897
+ /** @token Letter spacing */
2898
+ --_pont-label-letter-spacing: var(
2899
+ --pont-label-letter-spacing,
2900
+ var(--pont-sem-typography-tracking)
2901
+ );
2902
+ /** @token Line height */
2903
+ --_pont-label-line-height: var(
2904
+ --pont-label-line-height,
2905
+ var(--pont-ref-typography-leading-none)
2906
+ );
2907
+
2908
+ /** @token Text color */
2909
+ --_pont-label-color-fg: var(
2910
+ --pont-label-color-fg,
2911
+ var(--pont-ref-color-current)
2912
+ );
2913
+
2914
+ /* * -------- STATES -------- * */
2915
+
2916
+ /** @token Opacity when group/peer disabled */
2917
+ --_pont-label-opacity-disabled: var(
2918
+ --pont-label-opacity-disabled,
2919
+ var(--pont-sem-opacity-disabled)
2920
+ );
2921
+
2922
+ /** @token Cursor when peer disabled */
2923
+ --_pont-label-cursor-disabled: var(
2924
+ --pont-label-cursor-disabled,
2925
+ var(--pont-sem-cursor-disabled)
2926
+ );
2849
2927
  }
2928
+ }
2850
2929
 
2930
+ /*
2931
+ * ---------------------------------------------------------------------------
2932
+ * RECIPES
2933
+ * ---------------------------------------------------------------------------
2934
+ */
2935
+
2936
+ @layer pont.primitives {
2851
2937
  [data-pont-label] {
2852
- box-sizing: border-box;
2853
- margin: 0;
2938
+ box-sizing: var(--pont-ref-layout-box-border);
2854
2939
  display: flex;
2855
- align-items: center;
2856
- gap: 0.5rem;
2857
- user-select: none;
2940
+
2941
+ align-items: var(--_pont-label-items);
2942
+ justify-content: var(--_pont-label-justify);
2943
+
2944
+ column-gap: var(--_pont-label-gap-x);
2945
+ row-gap: var(--_pont-label-gap-y);
2946
+
2947
+ margin: 0;
2948
+
2949
+ font-family: var(--_pont-label-font-family);
2858
2950
  font-size: var(--_pont-label-font-size);
2859
- line-height: var(--pont-ref-typography-leading-none);
2860
2951
  font-weight: var(--_pont-label-font-weight);
2952
+ letter-spacing: var(--_pont-label-letter-spacing);
2953
+ line-height: var(--_pont-label-line-height);
2954
+
2955
+ color: var(--_pont-label-color-fg);
2956
+
2957
+ user-select: none;
2861
2958
  }
2862
2959
 
2863
- /* group-data-[disabled=true]: inside a disabled group (e.g. <pont-prim-field data-disabled>) */
2960
+ /* * -------- STATES -------- * */
2961
+
2962
+ /* * DISABLED * */
2963
+
2964
+ /* Group disabled (group-data-[disabled=true]): inside a disabled group,
2965
+ e.g. <pont-prim-field data-disabled> */
2864
2966
  :is([data-disabled="true"], [data-disabled=""]) [data-pont-label] {
2967
+ opacity: var(--_pont-label-opacity-disabled);
2865
2968
  pointer-events: none;
2866
- opacity: var(--pont-sem-opacity-disabled);
2867
2969
  }
2868
2970
 
2869
- /* peer-disabled: the label follows a disabled control (native or form-associated).
2870
- The second selector sees through a Tier 3 shell (<pont-prim-label, pont-label><label>): the shell
2871
- has no box, but it is still the DOM sibling. */
2971
+ /* Peer disabled (peer-disabled): the label follows a disabled control
2972
+ (native or form-associated). The second selector sees through a Tier 3
2973
+ shell (<pont-prim-label, pont-label><label>): the shell has no box, but it
2974
+ is still the DOM sibling. */
2872
2975
  :is(:disabled, [data-disabled]) ~ [data-pont-label],
2873
2976
  :is(:disabled, [data-disabled]) ~ [data-pont-shell] > [data-pont-label] {
2874
- cursor: var(--pont-sem-cursor-disabled);
2875
- opacity: var(--pont-sem-opacity-disabled);
2977
+ opacity: var(--_pont-label-opacity-disabled);
2978
+ cursor: var(--_pont-label-cursor-disabled);
2876
2979
  }
2877
2980
  }
2878
2981
 
@@ -3048,10 +3151,30 @@
3048
3151
 
3049
3152
  /* ../primitives/checkbox/checkbox.css */
3050
3153
  /*
3051
- * Checkbox. shadcn (Base UI, Vega):
3052
- * root: "peer relative shrink-0 outline-none after:absolute after:-inset-x-3
3053
- * after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50" + .cn-checkbox
3054
- * indicator: "grid place-content-center text-current transition-none" + .cn-checkbox-indicator
3154
+ * ===========================================================================
3155
+ * CHECKBOX STYLES
3156
+ * ===========================================================================
3157
+ *
3158
+ * shadcn/ui Base UI x Vega:
3159
+ * root:
3160
+ * peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none dark:bg-input/30
3161
+ * after:absolute after:-inset-x-3 after:-inset-y-2
3162
+ * focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50
3163
+ * group-has-disabled/field:opacity-50 disabled:cursor-not-allowed disabled:opacity-50
3164
+ * aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40
3165
+ * aria-invalid:aria-checked:border-primary
3166
+ * data-checked:border-primary data-checked:bg-primary dark:data-checked:bg-primary data-checked:text-primary-foreground
3167
+ * group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input group-has-[:focus-visible]/field-label:data-checked:border-primary
3168
+ * indicator:
3169
+ * grid place-content-center text-current transition-none [&>svg]:size-3.5
3170
+ *
3171
+ * Differences:
3172
+ * - The checkbox indicator is conditionally rendered. Instead of giving root
3173
+ * `data-checked:text-primary-foreground` and indicator `text-current`, we
3174
+ * give indicator `text-primary-foreground` via the
3175
+ * `--pont-checkbox-indicator-color-fg` token.
3176
+ * - Instead of `ring-0` when the field label is in focus, the checkbox sets
3177
+ * the ring shadow back to the initial/default state ring shadow.
3055
3178
  *
3056
3179
  * The host is form-associated, so `:disabled` and `:invalid` match it like a
3057
3180
  * native control. `aria-checked` lives in ElementInternals (not an attribute),
@@ -3061,100 +3184,362 @@
3061
3184
  * the element. shadcn's `dark:bg-input/30` is sem-color-field; the invalid
3062
3185
  * border/ring are sem-color-border-invalid / sem-color-ring-invalid.
3063
3186
  */
3187
+
3188
+ /*
3189
+ * ---------------------------------------------------------------------------
3190
+ * TOKENS
3191
+ * ---------------------------------------------------------------------------
3192
+ */
3193
+
3064
3194
  @layer pont.primitives {
3065
3195
  :is(pont-prim-checkbox, pont-checkbox, [data-pont-checkbox]) {
3066
- /** @token Background */
3067
- --_pont-checkbox-bg: var(--pont-checkbox-bg, var(--pont-sem-color-field));
3068
- /** @token Border */
3069
- --_pont-checkbox-border-color: var(--pont-checkbox-border-color, var(--pont-sem-color-field-border));
3070
- /** @token Corner radius */
3196
+ /** @token Align items */
3197
+ --_pont-checkbox-items: var(
3198
+ --pont-checkbox-items,
3199
+ var(--pont-ref-layout-items-center)
3200
+ );
3201
+ /** @token Justify content */
3202
+ --_pont-checkbox-justify: var(
3203
+ --pont-checkbox-justify,
3204
+ var(--pont-ref-layout-justify-center)
3205
+ );
3206
+
3207
+ /** @token Size (width and height) */
3208
+ --_pont-checkbox-size: var(
3209
+ --pont-checkbox-size,
3210
+ calc(var(--pont-ref-dimension) * 4)
3211
+ );
3212
+ /** @token Width */
3213
+ --_pont-checkbox-width: var(
3214
+ --pont-checkbox-width,
3215
+ var(--_pont-checkbox-size)
3216
+ );
3217
+ /** @token Height */
3218
+ --_pont-checkbox-height: var(
3219
+ --pont-checkbox-height,
3220
+ var(--_pont-checkbox-size)
3221
+ );
3222
+
3223
+ /** @token Background color */
3224
+ --_pont-checkbox-color-bg: var(
3225
+ --pont-checkbox-color-bg,
3226
+ var(--pont-sem-color-field)
3227
+ );
3228
+
3229
+ /** @token Border radius */
3071
3230
  --_pont-checkbox-radius: var(--pont-checkbox-radius, 4px);
3072
- /** @token Background when checked */
3073
- --_pont-checkbox-bg-checked: var(--pont-checkbox-bg-checked, var(--pont-sem-color-primary));
3074
- /** @token Check mark when checked */
3075
- --_pont-checkbox-fg-checked: var(--pont-checkbox-fg-checked, var(--pont-sem-color-primary-fg));
3076
- /** @token Border when checked */
3077
- --_pont-checkbox-border-color-checked: var(--pont-checkbox-border-color-checked, var(--_pont-checkbox-bg-checked));
3231
+
3232
+ /** @token Border width */
3233
+ --_pont-checkbox-border-width: var(
3234
+ --pont-checkbox-border-width,
3235
+ var(--pont-sem-border-width)
3236
+ );
3237
+ /** @token Border style */
3238
+ --_pont-checkbox-border-style: var(
3239
+ --pont-checkbox-border-style,
3240
+ var(--pont-sem-border-style)
3241
+ );
3242
+ /** @token Border color */
3243
+ --_pont-checkbox-border-color: var(
3244
+ --pont-checkbox-border-color,
3245
+ var(--pont-sem-color-field-border)
3246
+ );
3247
+
3248
+ --_pont-checkbox-inset-shadow: var(--pont-ref-shadow-inset-none);
3249
+ --_pont-checkbox-inset-ring: var(--pont-ref-shadow-inset-none);
3250
+
3251
+ --_pont-checkbox-ring-offset-width: var(
3252
+ --pont-sem-shadow-ring-offset-width
3253
+ );
3254
+ --_pont-checkbox-ring-offset: 0 0 0 var(--_pont-checkbox-ring-offset-width)
3255
+ var(--pont-sem-color-ring-offset);
3256
+
3257
+ /** @token Ring width */
3258
+ --_pont-checkbox-ring-width: var(
3259
+ --pont-checkbox-ring-width,
3260
+ var(--pont-sem-shadow-ring-width)
3261
+ );
3262
+ /** @token Ring color */
3263
+ --_pont-checkbox-ring-color: var(
3264
+ --pont-checkbox-ring-color,
3265
+ var(--pont-sem-color-ring)
3266
+ );
3267
+
3268
+ --_pont-checkbox-ring: 0 0 0
3269
+ calc(
3270
+ var(--_pont-checkbox-ring-width) +
3271
+ var(--_pont-checkbox-ring-offset-width)
3272
+ )
3273
+ var(--_pont-checkbox-ring-color);
3274
+
3275
+ /** @token Box shadow */
3276
+ --_pont-checkbox-shadow: var(
3277
+ --pont-checkbox-shadow,
3278
+ var(--pont-ref-shadow-xs)
3279
+ );
3280
+
3281
+ --_pont-checkbox-transition-property: var(
3282
+ --pont-ref-motion-trans-property-shadow
3283
+ );
3284
+ /** @token Transition duration */
3285
+ --_pont-checkbox-transition-duration: var(
3286
+ --pont-checkbox-transition-duration,
3287
+ var(--pont-sem-motion-trans-duration)
3288
+ );
3289
+ /** @token Transition timing function */
3290
+ --_pont-checkbox-transition-easing: var(
3291
+ --pont-checkbox-transition-easing,
3292
+ var(--pont-sem-motion-trans-easing)
3293
+ );
3294
+
3295
+ /** @token Cursor */
3296
+ --_pont-checkbox-cursor: var(
3297
+ --pont-checkbox-cursor,
3298
+ var(--pont-sem-cursor-interactive)
3299
+ );
3300
+
3301
+ --_pont-checkbox-after-inset-x: calc(var(--pont-ref-dimension) * -3);
3302
+ --_pont-checkbox-after-inset-y: calc(var(--pont-ref-dimension) * -2);
3303
+
3304
+ /** @token Align content */
3305
+ --_pont-checkbox-indicator-content: var(
3306
+ --pont-checkbox-indicator-content,
3307
+ var(--pont-ref-layout-content-center)
3308
+ );
3309
+ /** @token Justify content */
3310
+ --_pont-checkbox-indicator-justify: var(
3311
+ --pont-checkbox-indicator-justify,
3312
+ var(--pont-ref-layout-justify-center)
3313
+ );
3314
+
3315
+ /** @token Color (foreground) */
3316
+ --_pont-checkbox-indicator-color-fg: var(
3317
+ --pont-checkbox-indicator-color-fg,
3318
+ var(--pont-sem-color-primary-fg)
3319
+ );
3320
+
3321
+ /** @token Icon size (width and height) */
3322
+ --_pont-checkbox-indicator-icon-size: var(
3323
+ --pont-checkbox-indicator-icon-size,
3324
+ calc(var(--pont-ref-dimension) * 3.5)
3325
+ );
3326
+
3327
+ /* * -------- STATES -------- * */
3328
+
3329
+ /** @token Opacity when disabled */
3330
+ --_pont-checkbox-opacity-disabled: var(
3331
+ --pont-checkbox-opacity-disabled,
3332
+ var(--pont-sem-opacity-disabled)
3333
+ );
3334
+
3335
+ /** @token Cursor when disabled */
3336
+ --_pont-checkbox-cursor-disabled: var(
3337
+ --pont-checkbox-cursor-disabled,
3338
+ var(--pont-sem-cursor-disabled)
3339
+ );
3340
+
3341
+ /** @token Border color on focus */
3342
+ --_pont-checkbox-border-color-focus: var(
3343
+ --pont-checkbox-border-color-focus,
3344
+ var(--pont-sem-color-border-focus)
3345
+ );
3346
+
3347
+ /** @token Ring width on focus */
3348
+ --_pont-checkbox-ring-width-focus: var(
3349
+ --pont-checkbox-ring-width-focus,
3350
+ var(--pont-sem-shadow-ring-width-focus)
3351
+ );
3352
+ /** @token Ring color on focus */
3353
+ --_pont-checkbox-ring-color-focus: var(
3354
+ --pont-checkbox-ring-color-focus,
3355
+ var(--pont-sem-color-ring-focus)
3356
+ );
3357
+
3358
+ --_pont-checkbox-ring-focus: 0 0 0
3359
+ calc(
3360
+ var(--_pont-checkbox-ring-width-focus) +
3361
+ var(--_pont-checkbox-ring-offset-width)
3362
+ )
3363
+ var(--_pont-checkbox-ring-color-focus);
3364
+
3365
+ /** @token Border color when invalid */
3366
+ --_pont-checkbox-border-color-invalid: var(
3367
+ --pont-checkbox-border-color-invalid,
3368
+ var(--pont-sem-color-border-invalid)
3369
+ );
3370
+
3371
+ /** @token Ring width when invalid */
3372
+ --_pont-checkbox-ring-width-invalid: var(
3373
+ --pont-checkbox-ring-width-invalid,
3374
+ var(--pont-sem-shadow-ring-width-invalid)
3375
+ );
3376
+ /** @token Ring color when invalid */
3377
+ --_pont-checkbox-ring-color-invalid: var(
3378
+ --pont-checkbox-ring-color-invalid,
3379
+ var(--pont-sem-color-ring-invalid)
3380
+ );
3381
+
3382
+ --_pont-checkbox-ring-invalid: 0 0 0
3383
+ calc(
3384
+ var(--_pont-checkbox-ring-width-invalid) +
3385
+ var(--_pont-checkbox-ring-offset-width)
3386
+ )
3387
+ var(--_pont-checkbox-ring-color-invalid);
3388
+
3389
+ /** @token Background color when checked */
3390
+ --_pont-checkbox-color-bg-checked: var(
3391
+ --pont-checkbox-color-bg-checked,
3392
+ var(--pont-sem-color-primary)
3393
+ );
3394
+
3395
+ /** @token Border color when checked */
3396
+ --_pont-checkbox-border-color-checked: var(
3397
+ --pont-checkbox-border-color-checked,
3398
+ var(--_pont-checkbox-color-bg-checked)
3399
+ );
3078
3400
  }
3401
+ }
3402
+
3403
+ /*
3404
+ * ---------------------------------------------------------------------------
3405
+ * RECIPES
3406
+ * ---------------------------------------------------------------------------
3407
+ */
3079
3408
 
3409
+ @layer pont.primitives {
3080
3410
  :is(pont-prim-checkbox, pont-checkbox, [data-pont-checkbox]) {
3081
- cursor: var(--pont-sem-cursor-interactive);
3082
- box-sizing: border-box;
3411
+ box-sizing: var(--pont-ref-layout-box-border);
3412
+ display: flex;
3083
3413
  position: relative;
3414
+
3084
3415
  flex-shrink: 0;
3085
- display: flex;
3086
- align-items: center;
3087
- justify-content: center;
3088
- width: 1rem;
3089
- height: 1rem;
3090
- border: var(--pont-sem-border-width) var(--pont-sem-border-style) var(--_pont-checkbox-border-color);
3416
+ align-items: var(--_pont-checkbox-items);
3417
+ justify-content: var(--_pont-checkbox-justify);
3418
+
3419
+ width: var(--_pont-checkbox-width);
3420
+ height: var(--_pont-checkbox-height);
3421
+
3422
+ background-color: var(--_pont-checkbox-color-bg);
3423
+
3091
3424
  border-radius: var(--_pont-checkbox-radius);
3092
- background-color: var(--_pont-checkbox-bg);
3093
- outline: none;
3094
- color: inherit;
3095
- --pont-shadow: var(--pont-ref-shadow-xs);
3096
- box-shadow: var(--pont-ring-shadow), var(--pont-shadow);
3097
- transition-property: var(--pont-ref-motion-trans-property-shadow);
3098
- transition-duration: var(--pont-sem-motion-trans-duration);
3099
- transition-timing-function: var(--pont-sem-motion-trans-easing);
3425
+
3426
+ border-width: var(--_pont-checkbox-border-width);
3427
+ border-style: var(--_pont-checkbox-border-style);
3428
+ border-color: var(--_pont-checkbox-border-color);
3429
+
3430
+ outline: var(--pont-sem-border-outline-none);
3431
+
3432
+ box-shadow:
3433
+ var(--_pont-checkbox-inset-shadow), var(--_pont-checkbox-inset-ring),
3434
+ var(--_pont-checkbox-ring-offset), var(--_pont-checkbox-ring),
3435
+ var(--_pont-checkbox-shadow);
3436
+
3437
+ transition-property: var(--_pont-checkbox-transition-property);
3438
+ transition-duration: var(--_pont-checkbox-transition-duration);
3439
+ transition-timing-function: var(--_pont-checkbox-transition-easing);
3440
+
3441
+ cursor: var(--_pont-checkbox-cursor);
3100
3442
  }
3101
3443
 
3102
- /* Enlarged hit area: after:absolute after:-inset-x-3 after:-inset-y-2 */
3103
- :is(pont-prim-checkbox, pont-checkbox, [data-pont-checkbox])::after {
3104
- content: "";
3105
- position: absolute;
3106
- inset: -0.5rem -0.75rem;
3444
+ /* * -------- STATES -------- * */
3445
+
3446
+ /* * DISABLED * */
3447
+
3448
+ [data-pont-checkbox]:is(:disabled, [data-disabled]) {
3449
+ opacity: var(--_pont-checkbox-opacity-disabled);
3450
+ cursor: var(--_pont-checkbox-cursor-disabled);
3107
3451
  }
3108
3452
 
3453
+ /* Parent field has disabled */
3454
+ [data-slot="field"]:has(:disabled) [data-pont-checkbox] {
3455
+ opacity: var(--_pont-checkbox-opacity-disabled);
3456
+ }
3457
+
3458
+ /* * CHECKED * */
3459
+
3109
3460
  [data-pont-checkbox]:is([data-checked], [data-indeterminate]) {
3110
- background-color: var(--_pont-checkbox-bg-checked);
3111
- color: var(--_pont-checkbox-fg-checked);
3461
+ background-color: var(--_pont-checkbox-color-bg-checked);
3112
3462
  border-color: var(--_pont-checkbox-border-color-checked);
3113
3463
  }
3114
3464
 
3465
+ /* * FOCUS * */
3466
+
3115
3467
  [data-pont-checkbox]:focus-visible {
3116
- border-color: var(--pont-sem-color-border-focus);
3117
- --pont-ring-shadow: var(--pont-sem-shadow-ring-focus);
3468
+ border-color: var(--_pont-checkbox-border-color-focus);
3469
+
3470
+ box-shadow:
3471
+ var(--_pont-checkbox-inset-shadow), var(--_pont-checkbox-inset-ring),
3472
+ var(--_pont-checkbox-ring-offset), var(--_pont-checkbox-ring-focus),
3473
+ var(--_pont-checkbox-shadow);
3118
3474
  }
3119
3475
 
3476
+ /* * INVALID * */
3477
+
3120
3478
  [data-pont-checkbox][aria-invalid="true"] {
3121
- border-color: var(--pont-sem-color-border-invalid);
3122
- --pont-ring-shadow: var(--pont-sem-shadow-ring-invalid);
3479
+ border-color: var(--_pont-checkbox-border-color-invalid);
3480
+
3481
+ box-shadow:
3482
+ var(--_pont-checkbox-inset-shadow), var(--_pont-checkbox-inset-ring),
3483
+ var(--_pont-checkbox-ring-offset), var(--_pont-checkbox-ring-invalid),
3484
+ var(--_pont-checkbox-shadow);
3123
3485
  }
3124
- [data-pont-checkbox][aria-invalid="true"]:is([data-checked], [data-indeterminate]) {
3486
+
3487
+ /* * MISCELLANEOUS * */
3488
+
3489
+ /* Invalid and checked */
3490
+ [data-pont-checkbox][aria-invalid="true"]:is(
3491
+ [data-checked],
3492
+ [data-indeterminate]
3493
+ ) {
3125
3494
  border-color: var(--_pont-checkbox-border-color-checked);
3126
3495
  }
3127
3496
 
3128
- [data-pont-checkbox]:is(:disabled, [data-disabled]) {
3129
- cursor: var(--pont-sem-cursor-disabled);
3130
- opacity: var(--pont-sem-opacity-disabled);
3497
+ /* When inside a field label 'choice-card', the checkbox drops its 'focus'
3498
+ styles and the label parent performs them instead. */
3499
+ [data-slot="field-label"]:has(:focus-visible)
3500
+ [data-pont-checkbox]:not([data-checked]) {
3501
+ border-color: var(--_pont-checkbox-border-color);
3131
3502
  }
3132
3503
 
3133
- /* group-has-disabled/field:opacity-50 */
3134
- [data-slot="field"]:has(:disabled) [data-pont-checkbox] {
3135
- opacity: var(--pont-sem-opacity-disabled);
3504
+ [data-slot="field-label"]:has(:focus-visible)
3505
+ [data-pont-checkbox][data-checked] {
3506
+ border-color: var(--_pont-checkbox-border-color-checked);
3136
3507
  }
3137
3508
 
3138
- /* Inside a choice-card FieldLabel the label draws the focus ring instead. */
3139
3509
  [data-slot="field-label"]:has(:focus-visible) [data-pont-checkbox] {
3140
- --pont-ring-shadow: 0 0 #0000;
3141
- }
3142
- [data-slot="field-label"]:has(:focus-visible) [data-pont-checkbox]:not([data-checked]) {
3143
- border-color: var(--_pont-checkbox-border-color);
3510
+ box-shadow:
3511
+ var(--_pont-checkbox-inset-shadow), var(--_pont-checkbox-inset-ring),
3512
+ var(--_pont-checkbox-ring-offset), var(--_pont-checkbox-ring),
3513
+ var(--_pont-checkbox-shadow);
3144
3514
  }
3145
- [data-slot="field-label"]:has(:focus-visible) [data-pont-checkbox][data-checked] {
3146
- border-color: var(--_pont-checkbox-border-color-checked);
3515
+
3516
+ /* * -------- AFTER ('hit area') -------- * */
3517
+
3518
+ :is(pont-prim-checkbox, pont-checkbox, [data-pont-checkbox])::after {
3519
+ content: "";
3520
+
3521
+ position: absolute;
3522
+
3523
+ inset-inline: var(--_pont-checkbox-after-inset-x);
3524
+ inset-block: var(--_pont-checkbox-after-inset-y);
3147
3525
  }
3148
3526
 
3527
+ /* * -------- INDICATOR -------- * */
3528
+
3149
3529
  [data-pont-checkbox-indicator] {
3150
3530
  display: grid;
3151
- place-content: center;
3152
- color: currentColor;
3531
+
3532
+ align-content: var(--_pont-checkbox-indicator-content);
3533
+ justify-content: var(--_pont-checkbox-indicator-justify);
3534
+
3535
+ color: var(--_pont-checkbox-indicator-color-fg);
3536
+
3153
3537
  transition-property: var(--pont-ref-motion-trans-property-none);
3154
3538
  }
3539
+
3155
3540
  [data-pont-checkbox-indicator] > svg {
3156
- width: 0.875rem;
3157
- height: 0.875rem;
3541
+ width: var(--_pont-checkbox-indicator-icon-size);
3542
+ height: var(--_pont-checkbox-indicator-icon-size);
3158
3543
  }
3159
3544
  }
3160
3545
 
@@ -4347,6 +4732,11 @@
4347
4732
  :is(pont-prim-field, [data-pont-field]):is([data-invalid]:not([data-invalid="false"])) {
4348
4733
  color: var(--_pont-field-fg-invalid);
4349
4734
  }
4735
+ /* Its labels follow through the label's text colour, so a theme's
4736
+ --pont-label-color-fg does not hide the invalid state. */
4737
+ :is(pont-prim-field, [data-pont-field]):is([data-invalid]:not([data-invalid="false"])) [data-pont-label] {
4738
+ --_pont-label-color-fg: var(--_pont-field-fg-invalid);
4739
+ }
4350
4740
 
4351
4741
  /* vertical (default) and responsive below @md */
4352
4742
  :is(pont-prim-field, [data-pont-field]):is(:not([data-orientation]), [data-orientation="vertical"], [data-orientation="responsive"]) > * {
@@ -4401,11 +4791,10 @@
4401
4791
  line-height: var(--pont-ref-typography-leading-snug);
4402
4792
  }
4403
4793
 
4404
- /* ---------------- FieldLabel (native label; Label recipe applies too) ---------------- */
4794
+ /* ---------------- FieldLabel (native label; Label recipe applies too) ----------------
4795
+ flex and gap-2 come from the Label recipe, so the label tokens reach field labels. */
4405
4796
  [data-pont-field-label] {
4406
- display: flex;
4407
4797
  width: var(--pont-ref-dimension-size-fit);
4408
- gap: 0.5rem;
4409
4798
  line-height: var(--pont-ref-typography-leading-snug);
4410
4799
  }
4411
4800
  [data-pont-field][data-disabled]:not([data-disabled="false"]) [data-pont-field-label],